-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TB-173 Handle transactions stuck in processing state #1208
TB-173 Handle transactions stuck in processing state #1208
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1208 +/- ##
==========================================
+ Coverage 86.81% 86.83% +0.02%
==========================================
Files 87 87
Lines 5906 5916 +10
==========================================
+ Hits 5127 5137 +10
Misses 779 779
☔ View full report in Codecov by Sentry. |
…ub.com:jembi/openhim-core-js into TB-173-resolve-forever-processing-transactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arran-standish LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If OpenHIM crashes with a request in-flight (so before the down stream service responds) this transaction will stay in 'Processing' forever and does not provide a true reflection of the transaction state.
So on startup it will find all transactions in that state and update them to failed. It uses mongoose's cursor functionality which returns a stream and so shouldn't interfere with the main application as it will only process once the stream receives data. It also properly respects node's event loop and so won't block it (i.e.: incoming requests still get processed normally).