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

Fix %err_code/%err_detail for some error:transaction-end-before-headers #270

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

eduard-bagdasaryan
Copy link

@eduard-bagdasaryan eduard-bagdasaryan commented Oct 31, 2024

These format codes were empty in some situations for the second (and
subsequent) pipeline transactions if something went wrong with the
previous transaction (e.g., client connection was aborted, server
send an incomplete response body, etc.). Now a new ERR_STREAM_FAILURE
error code (together with 'WITH_CLIENT' error detail) marks all these
cases.

These format codes were empty in some situations for the second (and
subsequent) pipeline transactions if something went wrong with the
previous transaction (e.g., client connection was aborted, server
send an incomplete response body, etc.). Now a new ERR_STREAM_FAILURE
error code marks all these cases.
Also simplified the leftovers logging code,
removing checkLogging().
if (intputToConsume && !inBuf.isEmpty()) {
debugs(83, 5, "forgetting client " << intputToConsume << " bytes: " << inBuf.length());
inBuf.clear();
if (!terminatedAll) {
Copy link
Author

Choose a reason for hiding this comment

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

This flag prevents from logging twice a transaction with zero bytes (!pipeline.nrequests is true). The second terminateAll() call is from swanSong(). We could also reset inBuf below (so that leftovers would be false upon the second call).

http.req_sz = inBuf.length();
// XXX: Or we died while waiting for the pinned connection to become idle.
http.setErrorUri("error:transaction-end-before-headers");
http.updateError(bareError);
Copy link
Author

Choose a reason for hiding this comment

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

It looks like bareError became used after removing checkLogging() - we can probably remove it too.

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.

1 participant