Skip to content
This repository was archived by the owner on Aug 6, 2020. It is now read-only.

Don't write to finished response#123

Merged
garethbowen merged 2 commits into
masterfrom
3111-tasks-not-clearing
Feb 22, 2017
Merged

Don't write to finished response#123
garethbowen merged 2 commits into
masterfrom
3111-tasks-not-clearing

Conversation

@garethbowen
Copy link
Copy Markdown
Contributor

Comment thread handlers/changes.js Outdated
method: 'POST'
}, function(err, changes) {
if (feed.res.finished) {
// don't write to the response if it has already ended
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread handlers/changes.js
// don't write to the response if it has already ended
return;
}
cleanUp(feed);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is trying to clean up earlier to win the race condition! As discussed on Hangouts this shouldn't break anything...

@garethbowen garethbowen merged commit 16f5508 into master Feb 22, 2017
@garethbowen garethbowen deleted the 3111-tasks-not-clearing branch February 22, 2017 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants