canvas-lms/gems
Jacob Fugal 954e77d645 rework error handling in event stream
fixes CNVS-15153

 * don't raise if the configured cassandra database can't be connected
   to; instead, return nil (uncached, so it can be retried next time)
   and treat it as connected but unavailable
 * allow configuring whether an error is re-raised (configured true for
   test only in canvas), rather than peeking into rails directly from
   event stream.
 * allow registering callbacks to run on insert/update error via
   on_error
 * on insert/update error, before (maybe) reraising the error, call any
   registered callbacks
 * configure canvas to log to Rails.logger and statsd (removed from
   EventStream::Failure) on insert/update error

EventStream::Failure is now unused, but not yet removed from the code.
it should be considered deprecated and remain unused; it will be removed
in the near future.

test-plan:
 - start canvas in non-test mode (e.g. development mode) with cassandra
   and statsd configured and running
 - turn off cassandra, so even stream inserts should fail
 - change a grade (to trigger a GradeChange event)
 - with cassandra off, event insert should fail, but should *not*
   impede the remainder of the grade change action
 - EventStream::Failure record should *not* be created in the database
 - an error line should appear in the Rails log for the failed insert
 - the appropriate 'event_stream_failure.*' statsd counters should be
   incremented

Change-Id: I5c6d29c2a08276ccc06ebc8c1a59e0d33ce2cc4e
Reviewed-on: https://gerrit.instructure.com/40088
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-08-28 21:19:24 +00:00
..
active_polymorph begin rails 4 2014-08-27 23:09:17 +00:00
activesupport-suspend_callbacks begin rails 4 2014-08-27 23:09:17 +00:00
acts_as_list begin rails 4 2014-08-27 23:09:17 +00:00
adheres_to_policy begin rails 4 2014-08-27 23:09:17 +00:00
bookmarked_collection begin rails 4 2014-08-27 23:09:17 +00:00
canvas_breach_mitigation align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_cassandra align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_color extract color gem 2014-02-27 17:38:32 +00:00
canvas_crummy remove rails 2 support 2014-08-06 18:16:19 +00:00
canvas_ember_url align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_ext begin rails 4 2014-08-27 23:09:17 +00:00
canvas_http align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_kaltura bugfix: don't strip hyphens from media thumbnail URLs 2014-08-28 21:11:02 +00:00
canvas_mimetype_fu align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_quiz_statistics Quiz Stats - Multiple Answers 2014-06-05 09:12:19 +00:00
canvas_sanitize align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_slug clarify Slug vs. UUID and fix event stream 2014-07-11 16:58:42 +00:00
canvas_sort bundle check before bundle install for gem tests 2014-06-03 20:09:10 +00:00
canvas_statsd remove rails 2 support 2014-08-06 18:16:19 +00:00
canvas_stringex fix wiki_page_importer only_when_blank setting overwriting 2014-08-28 15:02:08 +00:00
canvas_text_helper align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
canvas_time begin rails 4 2014-08-27 23:09:17 +00:00
canvas_unzip add support for tar and tar.gz archives in content migrations 2014-08-01 12:36:27 +00:00
canvas_uuid clarify Slug vs. UUID and fix event stream 2014-07-11 16:58:42 +00:00
event_stream rework error handling in event stream 2014-08-28 21:19:24 +00:00
facebook align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
google_docs align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
handlebars_tasks align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
html_text_helper begin rails 4 2014-08-27 23:09:17 +00:00
i18n_extraction begin rails 4 2014-08-27 23:09:17 +00:00
i18n_tasks begin rails 4 2014-08-27 23:09:17 +00:00
incoming_mail_processor begin rails 4 2014-08-27 23:09:17 +00:00
json_token align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
linked_in align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
lti_outbound begin rails 4 2014-08-27 23:09:17 +00:00
multipart align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
paginated_collection align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
plugins/respondus_soap_endpoint begin rails 4 2014-08-27 23:09:17 +00:00
twitter begin rails 4 2014-08-27 23:09:17 +00:00
utf8_cleaner begin rails 4 2014-08-27 23:09:17 +00:00
workflow begin rails 4 2014-08-27 23:09:17 +00:00
test_all_gems.sh spec: vendor_gems test.sh result determination tweak 2014-02-24 19:54:21 +00:00