Skip to content

Conversation

@mostafa
Copy link
Member

@mostafa mostafa commented Dec 18, 2022

This PR fixes a few issues with connection management.

Update:
This is unstable for now. I'll try to fix it again.

Don't swallow errors
Add Cap getter function
Return ErrPoolExhausted error if the pool is cap'd and the capacity is full
NewPool now accepts either an EmptyPoolCapacity (0) or a positive integer to make an uncap'd or cap'd pool
Add new errors messages
Log when the pool is exhausted
Clarify log messages and add more comments
Flush connection to ensure all the data is sent
Server shutdown should happen before disconnections to avoid pool panics
Fix tests for server.go
Rename Reconnect to TryReconnect to check for pool exhaustion and client disconnection
Add IsExhausted method to check if the available client pool is exhausted
Fix comments and add more structured logs
@mostafa mostafa force-pushed the fix-concurrent-connection-handling branch from 2af611a to 4cd9138 Compare December 19, 2022 00:16
@mostafa mostafa merged commit 130bc38 into main Dec 19, 2022
@mostafa mostafa deleted the fix-concurrent-connection-handling branch December 19, 2022 02:02
@mostafa mostafa linked an issue Dec 19, 2022 that may be closed by this pull request
mostafa added a commit that referenced this pull request Dec 22, 2022
@mostafa mostafa linked an issue Dec 30, 2022 that may be closed by this pull request
mostafa added a commit that referenced this pull request Jan 29, 2023
…dling

Fix concurrent connection handling
mostafa added a commit that referenced this pull request Jan 29, 2023
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.

The connection is unstable when the client is put back in the pool Fix concurrent connection handling on connection close

2 participants