Commit Graph

27 Commits

Author SHA1 Message Date
Jon Willesen 3a4c1c24fd add timeouts to incoming message processor
incoming message processor should not wait indefinitely on
external connections. it now implements timeouts on external
connections that are controlled by the Canvas.timeout_protection
method. It uses incoming_message_processor as the serivce name,
which makes these meaningful settings to change the timeout
behavior:
 - service_incoming_message_processor_timeout
 - service_incoming_message_processor_cutoff
 - service_incoming_message_processor_error_ttl

fixes CNVS-8198

test plan:
 - see the incoming message processor wiki page for instructions
   on how to do the configuration and run these tests.
 - create a fifo in an empty directory, configure
   incoming_mail.yml to read from the directory, run
   script/process_incoming_emails and make sure it exits in
   30 seconds or so.
 - use nc -l <port> to listen on a port, configure
   incoming_mail.yml to access that port on localhost, and run
   script/process_incoming_emails and make sure it exits in
   30 seconds or so.
 - run script/process_incoming_emails against an actual email
   account and make sure it can still process emails normally.

Change-Id: I23c67c1e8c0581a1e6ca69ab2c7b8855090688d1
Reviewed-on: https://gerrit.instructure.com/24483
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-09-25 16:47:02 +00:00
Brian Palmer 5cd9b153d4 include canvas revision in health_check json response
test plan:

curl -H 'Accept: application/json' http://<domain>/health_check

If you have a VERSION file in your canvas dir it'll report that
version, otherwise "Unknown"

Change-Id: I43c72140541ea441d4ec96a4c179d8db775843b7
Reviewed-on: https://gerrit.instructure.com/24595
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-09-23 19:53:08 +00:00
Brian Palmer 2059907654 integrate memory/cpu stats gathering with RequestThrottle
This data will be needed for throttling abusive users based on cpu + db
usage.

refs CNVS-7008

This also replaces Canvas.sample_cpu_time with just using Process.times,
which works cross-platform and is likely faster.

test plan: specs, and you can verify that the STAT line is still being
logged to the rails log and the statsd messages are still being sent
over UDP if statsd is enabled

Change-Id: I6a5aac389e6de9caa12751d57532f32464acaeca
Reviewed-on: https://gerrit.instructure.com/23499
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-08-21 16:59:01 +00:00
Brian Palmer fc22e21830 remove redis.pipelined usage
Unfortuanately the current ruby redis gem doesn't support pipelining
with a redis cluster, even if all the commands are acting on the same
key. Since we're working on turning the data redis into a cluster, these
have got to go.

test plan: specs should cover all this. could also do a quick regression
test on failed logouts (shouldn't error, should still limit failed login
attempts)

Change-Id: Ifa950268416e9086b72610914d7efc8a816d628b
Reviewed-on: https://gerrit.instructure.com/23457
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-08-19 20:33:45 +00:00
Duane Johnson f100d205f3 refactor redis config loading
Refs CNVS-5333

Change-Id: Ie5104082a70604660537aa707ca012d055705150
Reviewed-on: https://gerrit.instructure.com/20514
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2013-05-23 19:04:35 +00:00
Brian Palmer cb5e957965 start adding rails 3.0 support
This can successfully load rails console and rails server. There are
many, many problems still. The idea is this won't change anything under
rails 2.3, it's all backwards compatible.

closes CNVS-4711

test plan: `touch RAILS3` in your Canvas Rails.root directory. The run
`bundle update` and verify that you get rails 3 installed. Run `bundle
exec rails c` to load console or `bundle exec rails s` to start a
webrick server. You can login, though the dashboard currently breaks.
Also jammit isn't working yet.

But more importantly, Rails 2.3 should still work same as ever. All
tests should pass, and a basic regression sanity check would be good too.

Change-Id: Idd6f35de88adde84cd2db3a650f44b71bd6e9684
Reviewed-on: https://gerrit.instructure.com/18453
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-22 19:08:40 +00:00
Cody Cutrer 39baee8b69 remove TEST_ENV_NUMBER hardcoding in config files
instead, you should be putting ERB in the config files

Change-Id: I75ddb75a77a6c7192583dd5eec88f4686d869e48
2013-03-05 15:02:31 -07:00
Shawn Meredith 2944785514 redis config fix automation
Change-Id: Ib1d99a1e15ff948ee7a0be5bd0c898b9acc882f4
Reviewed-on: https://gerrit.instructure.com/16123
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
2012-12-18 11:13:02 -07:00
Cody Cutrer c1a08e7119 generate safe file urls relative to the shard of the files domain
allows it to be a different shard than where the file is. I had
to remove type casting from dynamic finders that don't know how
to deal with non-integral global ids.

also cache s3 urls on the same shard as the attachment

test plan:
 * have multiple shards and S3 storage
 * have a single safe files domain
 * you should be able to upload and download files in all shards
 * verify that it's going against the files domain, not the normal
   domain

Change-Id: I2b498fc1df20d5b43bf20f702580451621eeaf6a
Reviewed-on: https://gerrit.instructure.com/15158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-11-12 09:17:37 -07:00
Brian Palmer c25465506a redis jobs backend
This supports all the features of our current delayed jobs backend,
including priorities, queues, jobs scheduled for the future, strands,
periodic jobs, etc.

Atomicity is guaranteed by using the new Lua scripting features of Redis
2.6, so this requires 2.6 (which is still only a release candidate as of this
time).

It's not yet production ready (see the TODO at the top of the
redis/job.rb file), so trying to start canvas in prod with redis jobs
configured will raise an error as a safeguard.

The tests have been modified to all pass with redis configured as the
jobs backend. Some selenium specs were removed because the jobs UI lost
some functionality that I didn't think was important enough to port to
redis (listing the most popular tags for future and failed jobs, for
example).

Change-Id: Ie57b15bae1d4ba7b2b2344c872411165551d1ac8
Reviewed-on: https://gerrit.instructure.com/12120
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-19 08:50:11 -06:00
Brian Palmer 45fa50d156 fix passenger redis connect
Change-Id: I57033b09969beaac8001c147dbdd22b59fea6bcd
Reviewed-on: https://gerrit.instructure.com/13603
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-09-10 17:40:48 -06:00
Cody Cutrer 72f298bf46 a little more flexibility with cache_store config refs #10114
no user visible change

test plan:
 * smoke test with and without caching configured

Change-Id: Ia21a996988021d647e56f85cd8ce818b64001681
Reviewed-on: https://gerrit.instructure.com/13248
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-08-28 10:55:26 -06:00
Brian Palmer 9ff857f5b0 link_data endpoint for canvas collections
Canvas will use this to pull the data about a link before creating a
collection item (currently uses embed.ly)

test plan: not possible to test this through the UI yet

Change-Id: Ie248be4081871aa3aa747510d96edc3c7cc3a0a6
Reviewed-on: https://gerrit.instructure.com/10777
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-05-21 10:35:31 -06:00
Brian Palmer 2b5cbcb73f handle redis failure on forking reconnect
test plan: run canvas through passenger and give it a bad IP for the
redis box, verify it can spin up new processes

Change-Id: I7d847da1c290261f89cbf2d792c875eefd20fe2c
Reviewed-on: https://gerrit.instructure.com/10551
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-04 11:25:04 -06:00
Brian Palmer 24514f54e0 Canvas.revision
and display the revision on /plugins

test plan: without a VERSION file, visit /plugins and see the "Unknown"
displayed. With a VERSION file, visit /plugins and see the first line of
that file displayed.

Change-Id: I0bcb3c855c70ba444158e17302eadab317dffb02
Reviewed-on: https://gerrit.instructure.com/9197
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-03-19 18:03:29 -06:00
Brian Palmer 3cd842817a reconnect redis when in passenger smart spawning mode
Change-Id: I125616609ef15354e324cc8c1bc971c6bc4a2620
Reviewed-on: https://gerrit.instructure.com/9322
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-03-09 10:21:55 -07:00
Brian Palmer a411f71755 add the wiziq web conference plugin
test plan: enable the plugin in /plugins, enter your creds, and start a
wiziq conference. teachers should be able to launch the conference, and
multiple students should be able to join.

closes #5738

Change-Id: I609542a0b13271e85dc18ff8b82ad6714736cc72
Reviewed-on: https://gerrit.instructure.com/8160
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-02-03 13:48:20 -07:00
Brian Palmer 39dc3f9cf0 use the redis data instance rather than rails cache for oauth codes
Change-Id: I882dc9fb4ad14388e8cae4e129e7175f3f140087
Reviewed-on: https://gerrit.instructure.com/4990
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-08-10 13:10:49 -06:00
Brian Palmer e6800c8b6a fix initialization of redis-cache cache store
The current version of redis-cache takes only the list of servers, it
doesn't support other config options like key prefix or database number.

Change-Id: If233c46d77b58650627dda75d7a8e1f2f212eb7f
Reviewed-on: https://gerrit.instructure.com/4801
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-07-25 16:35:29 -06:00
Brian Palmer 630200c32e support redis as well as memcache for a rails cache store
closes #4498

Change-Id: Icf29882d8c0d351574496ba0494c1d8c518a3e7f
Reviewed-on: https://gerrit.instructure.com/4580
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-07-20 14:59:03 -06:00
Brian Palmer 8564b1db63 optionally track completed job stats in redis
Right now this is just a data dump, pretty much.

Change-Id: I401cef17e2129556d99ca0a6547ae52712915650
Reviewed-on: https://gerrit.instructure.com/3970
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-06-01 10:58:37 -06:00
Zach Wily 91507fd052 add sample_cpu_time
Change-Id: I90bd0b66e893cb0cd2fdf20d8c584f720071b497
Reviewed-on: https://gerrit.instructure.com/3738
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-20 22:03:48 -06:00
Brian Palmer 304be4091b sample_memory method
refs #4226

Change-Id: Ia218096e4b2400edc60d0c2528544b11dd50625d
Reviewed-on: https://gerrit.instructure.com/3643
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-19 10:49:58 -06:00
Jon Jensen 6d226272df cast columns in dynamic finders, warn on all-nil argument lists
in production mode we now cast to the appropriate type and issue a warning
if it can't be cleanly cast (e.g. '' -> 0). if all arguments are nil (or
empty arrays, e.g. find_by_id([])) and we aren't in a scope, issue a
warning (sometimes we really do want nil when we're in a scope, e.g. line
216 of app/models/folder/rb).

in development/test mode, we now raise errors in the two warning scenarios
above (though that is configurable).

fixed several places in the code where specs failed due to the change, or
where inputs to dynamic finders looked problematic

Change-Id: Ifea851cb14d3e89b6df08ade8e83934579678f8b
Reviewed-on: https://gerrit.instructure.com/3434
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-03 11:06:04 -06:00
Brian Palmer b3e8d3b50a fix the mass assignment error raising option
Change-Id: Idc527a3d845f912fcbef56d336b5326e30c7964a
Reviewed-on: https://gerrit.instructure.com/2993
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-07 16:00:55 -06:00
Brian Palmer 78eeabeb21 support writing page views to a redis queue, closes #4052
A background periodic process pulls them off the queue, consolidates
updates, and writes them to the database.

Change-Id: I854b57932e3f6e311ce8c67971ed5208034ca6a5
Reviewed-on: https://gerrit.instructure.com/2803
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-03-25 10:03:57 -06:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00