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

dekaf: apply a 30 second idle session timeout #1700

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

jgraettinger
Copy link
Member

@jgraettinger jgraettinger commented Oct 15, 2024

Require that clients send a request within thirty seconds, or close the connection.

Tested with a shorter timeout using a local franz-go client.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)


This change is Reviewable

Require that clients send a request within thirty seconds,
or close the connection.
Copy link
Contributor

@jshearer jshearer left a comment

Choose a reason for hiding this comment

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

I don't think we should have any sessions normally hanging around with no activity in them, so by default I would expect this to not do much, unless we're somehow leaking Sessions, which this would surface quickly. LGTM 👍

}
.await;

metrics::gauge!("dekaf_total_connections").decrement(1);

w.shutdown().await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's your thinking on doing this after vs before decrementing the gauge? This way the gauge gets decremented even if there's an error shutting down the socket, which... probably still results in a closed socket in the end, so makes the gauge more accurate?

@jgraettinger jgraettinger merged commit e6a78da into master Oct 15, 2024
3 checks passed
@jgraettinger jgraettinger deleted the johnny/dekaf-timeout branch October 15, 2024 20:31
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.

2 participants