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

Try to identify customer issued close vs timeout #23442

Merged

Conversation

zhangxin511
Copy link
Contributor

@zhangxin511 zhangxin511 commented Jan 3, 2025

Description

For durable containers, 90% errors are status_unavialbe, which essentially 499, that connect closed before response sent. 90% of such errors, are actually pretty short, less than 2 seconds. These errors were due to client closed the connection too fast and we can replicate this easily. However, on our logging middleware, these all recorded with status code status_unknow. This change will try to identify these connection break is due to client closed or due to the idle timeout we set

Breaking Changes

N/A

@github-actions github-actions bot added area: server Server related issues (routerlicious) base: main PRs targeted against main branch labels Jan 3, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

server/routerlicious/packages/services-utils/src/morganLoggerMiddleware.ts:74

  • The word 'enssentially' should be corrected to 'essentially'.
// We observed 499 errors are sometime due to client side closed quickly before server can respond. Sometimes are due to

server/routerlicious/packages/services-utils/src/morganLoggerMiddleware.ts:80

  • Ensure that the new behavior for differentiating client disconnections and server timeouts is covered by tests.
request.socket.on("close", () => {

response.locals.clientDisconnected = false;
response.locals.serverTimeout = false;
// We observed 499 errors are sometime due to client side closed quickly before server can respond. Sometimes are due to
// server side timeout which got terminated by the idle timeout we set in createAndConfigureHttpServer call.
Copy link
Preview

Copilot AI Jan 3, 2025

Choose a reason for hiding this comment

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

The word 'timoout' should be corrected to 'timeout'.

Suggested change
// server side timeout which got terminated by the idle timeout we set in createAndConfigureHttpServer call.
75 + // server side timeout which got terminated by the idle timeout we set in createAndConfigureHttpServer call.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@zhangxin511 zhangxin511 merged commit ee2a392 into main Jan 3, 2025
34 checks passed
@zhangxin511 zhangxin511 deleted the zhangxin/Distinguish499ByServerTimeoutOrClientInitilized branch January 3, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants