-
Notifications
You must be signed in to change notification settings - Fork 42
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
Keep worker alive if update_documents fails #37
Open
tcrossland
wants to merge
7
commits into
DockYard:master
Choose a base branch
from
tcrossland:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b680885
fix: edge case verification failure
tcrossland 3d6d735
Merge remote-tracking branch 'upstream/master'
tcrossland fb1478a
#24: worker was dying if update_documents failed
tcrossland 2b9bba5
fix: tests failed as update_documents was deferred from Worker.init
tcrossland 82fea92
refactor: avoid process sleep in tests
tcrossland 0499952
refactor: schedule notification of test pid in init
tcrossland cfb424e
test: test case for dns failure
tcrossland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Doing sleep during a test isn't ideal. It would be better if the
pid
of the test could be added as an option and if present the worker would notify the pid when the document was updated. Then the test wouldassert_received
for that message and timeout/fail if it doesn't happen.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.
I agree. The test doesn't really need to be notified when update_documents completes (it's mocked), but the
:update_documents
should be in the worker's queue before the test continues.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.
as it stands, I think the PR's architecture implementation is wrong. The update_documents function should be blocking. I'd like to see failing test cases and work back from there to a solution
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.
update_documents
is still blocking. It was already ahandle_info
before this PR, I haven't changed that, and it schedules itself periodically, as before. I deferred it's invocation frominit/1
to allow the worker (and it's supervision tree) to remain alive in the case of a temporary network error (domain resolution failure, for example).Feel free to look at alternatives (#30).