-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle interrupts: synchronous KeyManagementService
uses Socket IO (open, read, write), which is interruptible in a virtual thread
#1204
Conversation
…(open, read, write), which is interruptible in a virtual thread JAVA-5139
JAVA-5139
@@ -348,7 +350,9 @@ private void decryptKeys(final MongoCryptContext cryptContext) { | |||
} | |||
cryptContext.completeKeyDecryptors(); | |||
} catch (Throwable t) { | |||
throw wrapInClientException(t); | |||
throw translateInterruptedException(t, "Interrupted while reading") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to translate interrupted exceptions both here and in the KeyManagementService (which this is calling)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if we want to add messages like "interrupted while connecting/writing/reading" which is what we do for streams, and why I did it this way here. But if it's fine to just have a single message "interrupted while doing IO", or no message at all, I'll be happy to remove the translating code from Crypt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
driver-sync/src/main/com/mongodb/client/internal/KeyManagementService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is very similar to #1203, which is why I assigned the same reviewers.
JAVA-5139