azure-service-bus-java icon indicating copy to clipboard operation
azure-service-bus-java copied to clipboard

Fix to allow to retry of failed close calls on entities

Open yvgopal opened this issue 5 years ago • 0 comments

Fixes part 1 of #366 If for any reason, close call on a sender or receiver or messaging factory fails, the state of the object remains 'closing=true' and calling close again will simply return. This fix resets the closing flag to false if close fails, so client application can call close again. of course, calling close again doesn't guarantee that it succeeds. Even if close repeatedly fails, state of the objects will not be stuck in 'closing=true' state.

Another thing to handle concurrent or simultaneous close calls. If one threads called close and is waiting for close to finish, any other threads that call close will return immediately indicating the entity is closed. It is semantically wrong. This fix also addresses it.

Added tests to confirm it's behaving right.

yvgopal avatar Jul 19 '19 01:07 yvgopal