This repository was archived by the owner on Aug 6, 2020. It is now read-only.
Don't write to finished response#123
Merged
Merged
Conversation
| method: 'POST' | ||
| }, function(err, changes) { | ||
| if (feed.res.finished) { | ||
| // don't write to the response if it has already ended |
Contributor
There was a problem hiding this comment.
I'd add something like "In this case the change will be ignored, but it's ok because it'll be fetched by the next changes request that comes in"
| // don't write to the response if it has already ended | ||
| return; | ||
| } | ||
| cleanUp(feed); |
Contributor
There was a problem hiding this comment.
Is this moved up here to try avoiding reusing the same feed?
The abort l. 159 looks like it would cause trouble in case of !err, since you haven't written to the feed yet? (don't actually know what abort does, maybe not)
Contributor
Author
There was a problem hiding this comment.
Yeah this is trying to clean up earlier to win the race condition! As discussed on Hangouts this shouldn't break anything...
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
medic/cht-core#3111