-
Notifications
You must be signed in to change notification settings - Fork 437
Invalidate existing enclave session during connection (re)connect #2638
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2638 +/- ##
============================================
- Coverage 51.52% 51.51% -0.01%
+ Complexity 3990 3988 -2
============================================
Files 147 147
Lines 33706 33720 +14
Branches 5631 5636 +5
============================================
+ Hits 17366 17371 +5
- Misses 13886 13894 +8
- Partials 2454 2455 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
need to add test
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
Outdated
Show resolved
Hide resolved
if (enclaveProvider != null) { | ||
if (connectionlogger.isLoggable(Level.FINE)) { | ||
connectionlogger.fine("Invalidating existing enclave session for enclave provider : " + enclaveProvider); | ||
} | ||
enclaveProvider.invalidateEnclaveSession(); | ||
} |
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.
Can this be changed to just call invalidateEnclaveSessionCache()
now?
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.
No blockers. One small white space nit and if we can de-dup the code block, that'd be great. Approved with or without the changes.
@@ -87,7 +89,7 @@ public final class SQLServerException extends java.sql.SQLException { | |||
static final int DATA_CLASSIFICATION_NOT_EXPECTED = 11; | |||
static final int DATA_CLASSIFICATION_INVALID_LABEL_INDEX = 12; | |||
static final int DATA_CLASSIFICATION_INVALID_INFORMATION_TYPE_INDEX = 13; | |||
|
|||
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.
Nit: Stray empty space
Description:
For AE with secure enclave, the driver connections receives an error 33195 - Internal enclave error. Enclave was provided with an invalid session handle. For more information, contact Customer Support Services, post failovers ( in case of Always On setup).
This could be happening because of driver using existing enclave session from the enclaveCache in the driver.
This fix invalidates the existing enclave session as part of the connect method.