-
Notifications
You must be signed in to change notification settings - Fork 31
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
Workaround for actix-web bug. #379
Conversation
There is a bug in actix (actix/actix-web#1313) that prevents it from dropping HTTP connections on client disconnect unless the endpoint periodically sends some data. As a result, all API-based data transfers eventually start to fail in the UI. As a workaround, we generate an empty output chunk if there is no real payload to send for more than 3 seconds. Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Wouldn’t it be better to add a ping/ack endpoint? That’d also allow us to check for uptime in addition to addressing this |
Problem is, when the client disconnects there won't be a ping and the connection will remain around forever. |
Well yah, when the client disconnects it can no longer send pings to the server so the connection gets dropped |
Ok, fair enough. But today you can monitor a table with a simple |
// that prevents it from dropping HTTP connections on client disconnect | ||
// unless the endpoint periodically sends some data. As a workaround, | ||
// if there is not real payload to send for more than 3 seconds, we will | ||
// generate an empty chunk. Note that it takes 6s, i.e., 2x the timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this timeout period internal to actix or something we can (or do) configure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actix doesn't care. Basically, whenever a chunk is sent out, actix checks connection status and drops the request if the client closed their end of the connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Would we need to make this 3s duration configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super eager to add that control knob, and especially expose it to the client. Let's not do it now.
There is a bug in actix (actix/actix-web#1313) that prevents it from dropping HTTP connections on client disconnect unless the endpoint periodically sends some data. As a result, all API-based data transfers eventually start to fail in the UI. As a workaround, we generate an empty output chunk if there is no real payload to send for more than 3 seconds.