pools of size 0 should return transient connections/sessions
Closed this issue · 5 comments
In case a pool does not contain any cached connections or sessions, it might make sense to establish transient connections and sessions when a caller tries to get a connection or a session from the pool.
Hey @jxsl13 ,
I want to pick this up.
Is it okay to pick this up as a good first time issue?
Sure, but I will give lots of feedback, as I have already an idea how this should be handled.
This behavior will basically need to be implemented for
pool.Pool
pool.ConnectionPool
pool.SessionPool
Sure.
I am really looking forward to learn from your feedbacks.
I'll have a detailed look at the codebase.
I am still unsure of the exact problem statement, but in simple words I believe that in case the connection pool has no connections left i.e pool size of 0 , then if callers tries to connect, we will return some temporary connection to the caller.
That connection will not be stored in the pool connections.
I'll look at the codebase once.
But do let me know in case I'm missing anything.
the problem is slightly different.
You define a connection pool of size x. In case that size is 0, all connections of this pool should be temporary (transient) connections.
Currently if the connection pool has like 10 connections and all of those connections are in use, then the next GetConnection() will block until someone else puts a connection back into the pool. This behavior should stay the same.
When closing the pool, I would like to scale the pool down to 0 and still allow callers to fetch temporaty connections.
This might allow for the pools to either ack or nack messages before the application is shut down.
Maybe the whole idea is not how that should work, I dunno, gotta play around a little bit with the code.
The more I think about this problem the less this scaling down to 0 makes sense...
Maybe not a good first issue.