Skip to content

Conversation

iPeluwa
Copy link
Contributor

@iPeluwa iPeluwa commented Sep 10, 2025

max_connections: 0 (no restriction) by default
Use .with_max_connections(500) to configure
Graceful connection rejection when limit reached
Prevents resource exhaustion under load

- Add max_connections field to ServerOptions (default: 0 = no limit)
- Use tokio::sync::Semaphore to limit concurrent connections when max_connections > 0
- Gracefully reject excess connections with warning log instead of crashing
- Connection permits are automatically released when connections close
- Configure via ServerOptions::new().with_max_connections(500)
- Added tests to verify default behavior and configuration options
- Prevents resource exhaustion under high connection load
Copy link
Member

@sunng87 sunng87 left a comment

Choose a reason for hiding this comment

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

LGTM

@sunng87 sunng87 merged commit effa5d0 into datafusion-contrib:master Sep 10, 2025
6 checks passed
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