Add new optional parameter to have all sockets send KeepAlive packets#2110
Closed
carboneater wants to merge 2 commits intomysqljs:masterfrom
carboneater:master
Closed
Add new optional parameter to have all sockets send KeepAlive packets#2110carboneater wants to merge 2 commits intomysqljs:masterfrom carboneater:master
carboneater wants to merge 2 commits intomysqljs:masterfrom
carboneater:master
Conversation
946727b to
37fbbdd
Compare
This was referenced Dec 11, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So I work with the author of #1939
Today I decided that replacing our custom pool management with this project's implementation would solve a few bugs we had.
And it did, great job, folks!
However, the trigger happy load balancers are here to stay.
Extending the fix given in the above issue was easy enough with Pools. (Hooking to the Pool's
connectevent worked like a charm). PoolClusters were another thing altogether...And (as we're working in TypeScript), the code was actually messier with the need to expose internal variables and attach event listeners to every internal pool.
Hence this PR to add another configuration option to specify a keepAliveDelay, that, if set, is applied when a socket is created. Otherwise, it will use the system's settings. (Node's default is to not use a KeepAlive.)
Side note : I'd be more than happy to update @types/mysql to reflect these changes once they are merged.