Menu

4.0.11 "leaks" WriteTimeoutHandler thread from InMemoryLdapServer

2019-07-20
2019-07-21
  • Surendar Chandra

    I use the inMemoryLdapServer for some unit tests and call shutdown on them when done. In 4.0.7, it was fine but upgrading to 4.0.11 detects a thread leak of "Write Timeout Handler Timer". What is the best way to it down? Thanks @dirmgr

     
  • Neil Wilson

    Neil Wilson - 2019-07-21

    This is the result of a change introduced in the 4.0.11 release. In earlier releases, there was an issue in which if an attempt to write to the server was blocked, it could wait indefinitely. It uses a Java timer to accomplish this, and a single timer instance is shared across all connections. Even after all connections have been closed, the timer instance remains active so that it can be reused by any subsequent connections that get established.

    I have just committed a change that redesigns the timer mechanism so that it's shut down when all connections have been closed. As long as at least one connection is established, a timer will be active, and any new connections created while there is an active timer will reuse that timer. However, once all connections have been closed, then the timer will be shut down. Upon creating a new connection after that, it will create a new timer instance that is eligible to be shared among any further connections.

     
  • Surendar Chandra

    Awesome, We were worried about just this scenario (ran into similar issues with other interactions with external services). We pick up artifacts via maven. Any ideas when we will have a public release with this fix? Thanks again

     
  • Neil Wilson

    Neil Wilson - 2019-07-21

    I don't currently have a hard target date for the next release, but it'll probably be at least a couple of months. However, there is no issue with continuing to use the current version, since the issue is completely benign and doesn't actually cause a problem.

     

Log in to post a comment.