Sally7
Sally7 copied to clipboard
fix: Prevent exception on return of job ID to disposed pool
Currently when the connection is disposed and requests are still in the queue they will except because the job ID can no longer be returned to the pool. Making the exception on ReturnJobId
conditional on a new _disposed
flag prevents the exception from being thrown, but it does permit 'successful' returns to a disposed pool.
@gfoidl please let me know what you think. This is hitting us in production now, so I'll probably merge this quickly.
@gfoidl No need to hurry, hotfixed the previous release, because there's some unreleased changes on main anyway.
Thanks @gfoidl, appreciate your opinion a lot. I intend to add some unit tests for this behavior as well, so I'm not merging straight away.