Closed teyc closed 4 years ago
I've observed error logs reporting that _semaphore has already been disposed at this line https://github.com/NimbusAPI/Nimbus/blob/master/src/Nimbus/Infrastructure/RequestResponse/BusRequestSender.cs#L77
_semaphore
Here's what might be happening -
Under load, if services are slow to respond to Nimbus requests, the ResponseCorrelationWrapper could have expired and disposed before l WaitForResponse gets called https://github.com/NimbusAPI/Nimbus/blob/master/src/Nimbus/Infrastructure/RequestResponse/BusRequestSender.cs#L103
ResponseCorrelationWrapper
WaitForResponse
The expiry time is calculated here https://github.com/NimbusAPI/Nimbus/blob/master/src/Nimbus/Infrastructure/RequestResponse/BusRequestSender.cs#L77 and depending on how busy the threadpool is, it can be a while before it gets to line 103.
Options for fixing this are
RequestResponseCorrelationWrapper
I've observed error logs reporting that
_semaphore
has already been disposed at this line https://github.com/NimbusAPI/Nimbus/blob/master/src/Nimbus/Infrastructure/RequestResponse/BusRequestSender.cs#L77Here's what might be happening -
Under load, if services are slow to respond to Nimbus requests, the
ResponseCorrelationWrapper
could have expired and disposed before lWaitForResponse
gets called https://github.com/NimbusAPI/Nimbus/blob/master/src/Nimbus/Infrastructure/RequestResponse/BusRequestSender.cs#L103The expiry time is calculated here https://github.com/NimbusAPI/Nimbus/blob/master/src/Nimbus/Infrastructure/RequestResponse/BusRequestSender.cs#L77 and depending on how busy the threadpool is, it can be a while before it gets to line 103.
Options for fixing this are
RequestResponseCorrelationWrapper
instance and see whether it has been disposed or not before proceeding,