mycroes / Sally7

C# implementation of Siemens S7 connections with a focus on performance
MIT License
57 stars 23 forks source link

fix: Prevent exception on return of job ID to disposed pool #48

Closed mycroes closed 8 months ago

mycroes commented 11 months ago

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.

mycroes commented 11 months ago

@gfoidl No need to hurry, hotfixed the previous release, because there's some unreleased changes on main anyway.

mycroes commented 11 months ago

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.