Some places in the code rely on catching an exception in ErrorCategory::Interruption to check whether an OperationContext has been interrupted. This is a problem if any callsites ever call OperationContext::markKilled with an error code that isn't in this error category, but there's not currently anything preventing that from happening. Technically, using the Interruption category to check for OperationContext interrupt is also error prone since it's possible that other things could throw an Interruption error, so call sites which need to check for interrupt should probably catch all exceptions and then actually check the OperationContext to see if it's been interrupted.
This ticket should either:
- Add an invariant to markKilled to make sure all error codes passed to it belong to ErrorCategory::Interruption, and fix the broken call sites, or
- Fix all places we catch Interruption errors and rely on that to assume the OperationContext has been interrupted to catch all DBExceptions and check the OperationContext itself for interrupt