Skip to content

Conversation

@moonchen
Copy link
Contributor

@moonchen moonchen commented Aug 7, 2025

A server can close a connection while we're expecting a response. For example, the server may close the connection due to a keep-alive timeout. This results in a 502 response to the client. Log an error in this case, so that the administrator has a chance to adjust the keep-alive timeout on the ATS side to avoid this situation.

A server can close a connection while we're expecting a response.  For example, the server may close the connection due to a keep-alive timeout.  This results in a 502 response to the client.  Log an error in this case, so that the administrator has a chance to adjust the keep-alive timeout on the ATS side to avoid this situation.
@moonchen moonchen added this to the 10.2.0 milestone Aug 7, 2025
@moonchen moonchen self-assigned this Aug 7, 2025
@cmcfarlen cmcfarlen requested a review from bneradt August 11, 2025 22:14
Copy link
Contributor

@bneradt bneradt left a comment

Choose a reason for hiding this comment

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

It would be good to have @bryancall look at this when he is back from PTO. I think we were considering moving away from error.log and transitioning content to diags.log.

That said, if that is not the case, I agree that these connection-level messages thematically fit error.log. If we're keeping error.log.

Copy link
Contributor

@bneradt bneradt left a comment

Choose a reason for hiding this comment

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

Looks like we're OK with this from our PR/issue meeting. But let's include the origin URL.

Copy link
Contributor

@bneradt bneradt left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for adding the URL.

Comment on lines 1034 to 1052
switch (event) {
case VC_EVENT_EOS:
log_server_close_with_origin(t_state, "Server closed connection while reading PUSH response header.");
_ua.get_entry()->eos = true;
// Fall through

case VC_EVENT_READ_READY:
case VC_EVENT_READ_COMPLETE:
// More data to parse
break;

case VC_EVENT_ERROR:
case VC_EVENT_INACTIVITY_TIMEOUT:
case VC_EVENT_ACTIVE_TIMEOUT:
// The user agent is hosed. Send an error
set_ua_abort(HttpTransact::ABORTED, event);
call_transact_and_set_next_state(HttpTransact::HandleBadPushRespHdr);
return 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The new message says "Server closed...", but the code around these events seem to indicate client events while waiting for the response. Maybe "Client closed..." is appropriate? Or maybe I'm misunderstanding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. This isn't a server close as I thought. I'm going to remove this message and only keep the one where the server closes.


switch (event) {
case VC_EVENT_EOS:
log_server_close_with_origin(t_state, "Server closed connection while reading response header");
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: maybe also end this in a period to be consistent with the other log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@moonchen moonchen requested a review from bneradt December 1, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants