Skip to content
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

Avoid spurious HTTP 400 after GET to /_status #528

Merged
merged 1 commit into from
Sep 21, 2015

Conversation

stevendanna
Copy link
Contributor

After making a GET to status using a persistent HTTP/1.1 connection, the
client might see a spurious HTTP 400 response (after already receiving a
response to their status request). Since most clients that make requests
to /_status either use HTTP 1.0 or close their connection after reading
the response, they never see the 400.

The 400 seems to be sent whenever the process started with spawn_monitor
exits. gather_health_workers is the only function with a receive clause
for the DOWN messages, but that function likely has already returned
when it is recieved. Calling demonitor/2 with the flush option ensures
those message never hit our mailbox (and are removed if they are already
in our mailbox).

It is unclear to me whether this represents an upstream bug in
mochiweb/webmachine.

@joedevivo
Copy link
Contributor

This works. We can merge it, or not monitor the processes in the first place.

After making a GET to status using a persistent HTTP/1.1 connection, the
client might see a spurious HTTP 400 response (after already receiving a
response to their status request). Since most clients that make requests
to /_status either use HTTP 1.0 or close their connection after reading
the response, they never see the 400.

The 400 seems to be sent whenever the process started with spawn_monitor
exits. gather_health_workers is the only function with a receive clause
for the DOWN messages, but that function likely has already returned
when it is received. Calling demonitor/2 with the flush option ensures
those message never hit our mailbox (and are removed if they are already
in our mailbox).

It is unclear to me whether this represents an upstream bug in
mochiweb/webmachine.

ChangeLog-Entry: Fix bug where persistent clients would receive HTTP 400
after successful calls to the /_status endpoint.
@stevendanna stevendanna force-pushed the ssd/spurious-status-400s branch from 5cdc9de to 2b9c719 Compare September 21, 2015 08:44
stevendanna added a commit that referenced this pull request Sep 21, 2015
Avoid spurious HTTP 400 after GET to /_status
@stevendanna stevendanna merged commit 11ef1ed into master Sep 21, 2015
@stevendanna stevendanna deleted the ssd/spurious-status-400s branch December 9, 2015 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants