You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
We reconfigure log4j settings during the runtime with new PropertyConfigurator().doConfigure(reader,
LogManager.getLoggerRepository());The Commons pools gets closed inbiz.paluch.logging.gelf.intern.sender.GelfREDISSender#closebutRedisSenderPoolProviderstill holds the closedJedisPoolWhen now the log4j properties is reconfigured RedisSenderPoolProvider` delivers a closed JedisPool.
On Closing JedisPool pool, it also must be removed from RedisSenderPoolProvider.
The text was updated successfully, but these errors were encountered:
Thanks for bringing up that issue. The problem is here that RedisSenderPoolProvider is a shared/static holder for various kinds of JedisPool instances. You can have multiple appenders that consume pools. If we close a pool because an appender gets closed, all other active appenders will see a closed JedisPool.
I think we need something like a refcounter to track usage and close the actual pool. Instead of shutting down the Pool, we'd rather decrement the refcounter and if it reaches zero, then we can safely remove the pool from RedisSenderPoolProvider.
ok, but if the JedisPool gets closed. how can other appenders use the closed one? It is not any more usable, no? I have made a fix as a pull request, to demonstrate the solution. On JedisPool#destroy, it gets removed from the RedisSenderPoolProvider
Thanks a lot. Reiterating on the issue, we need to track refcount, otherwise, other appenders will see a closed pool. I have a draft locally to fix the issue. Do you mind if we close #247 in favor of my refcnt implementation?
We now correctly handle the lifecycle for Jedis Pool instances by tracking their usage count (refCnt) and disposing resources.
Previously, two appenders could obtain the same pool and if one appender was closed, the pool was also disposed for the other appender that didn't request shutdown. Also, disposed pool remained referenced so subsequent retrievals to the same pool (as per URI) returned a destroyed pool so that the sender wasn't able to connect to Redis anymore.
Pool retrieval and disposal is now synchronized to avoid races and to ensure a proper state.
Make sure that:
PropertyConfigurator().doConfigure(reader,
LogManager.getLoggerRepository());
The Commons pools gets closed in
biz.paluch.logging.gelf.intern.sender.GelfREDISSender#closebut
RedisSenderPoolProviderstill holds the closed
JedisPoolWhen now the log4j properties is reconfigured
RedisSenderPoolProvider` delivers a closed JedisPool.On Closing JedisPool pool, it also must be removed from RedisSenderPoolProvider.
The text was updated successfully, but these errors were encountered: