-
Notifications
You must be signed in to change notification settings - Fork 312
Remove CER #3535
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
base: main
Are you sure you want to change the base?
Remove CER #3535
Changes from all commits
c784c7f
224ddf6
7e1ff6d
e997f8d
849d49a
453a1bc
2369226
0a943ad
1d2ac05
c4cfb0b
cf11b5c
b093c7e
7c8cdd8
42d37b6
7988457
e36a480
ba42912
d7fccff
b88fb55
6770634
b1e2386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1237,35 +1237,12 @@ public override void ChangeDatabase(string database) | |
SqlStatistics statistics = null; | ||
RepairInnerConnection(); | ||
SqlClientEventSource.Log.TryCorrelationTraceEvent("SqlConnection.ChangeDatabase | API | Correlation | Object Id {0}, Activity Id {1}, Database {2}", ObjectID, ActivityCorrelator.Current, database); | ||
TdsParser bestEffortCleanupTarget = null; | ||
|
||
#if NETFRAMEWORK | ||
RuntimeHelpers.PrepareConstrainedRegions(); | ||
#endif | ||
|
||
try | ||
{ | ||
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(this); | ||
statistics = SqlStatistics.StartTimer(Statistics); | ||
InnerConnection.ChangeDatabase(database); | ||
} | ||
catch (System.OutOfMemoryException e) | ||
{ | ||
Abort(e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we still be calling |
||
throw; | ||
} | ||
catch (System.StackOverflowException e) | ||
{ | ||
Abort(e); | ||
throw; | ||
} | ||
catch (System.Threading.ThreadAbortException e) | ||
{ | ||
Abort(e); | ||
#if NETFRAMEWORK | ||
SqlInternalConnection.BestEffortCleanup(bestEffortCleanupTarget); | ||
#endif | ||
throw; | ||
} | ||
finally | ||
{ | ||
SqlStatistics.StopTimer(statistics); | ||
|
@@ -1328,15 +1305,10 @@ public override void Close() | |
} | ||
|
||
SqlStatistics statistics = null; | ||
TdsParser bestEffortCleanupTarget = null; | ||
Exception e = null; | ||
|
||
#if NETFRAMEWORK | ||
RuntimeHelpers.PrepareConstrainedRegions(); | ||
#endif | ||
|
||
try | ||
{ | ||
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(this); | ||
statistics = SqlStatistics.StartTimer(Statistics); | ||
|
||
Task reconnectTask = _currentReconnectionTask; | ||
|
@@ -1362,27 +1334,6 @@ public override void Close() | |
_statistics._closeTimestamp = ADP.TimerCurrent(); | ||
} | ||
} | ||
catch (System.OutOfMemoryException ex) | ||
{ | ||
e = ex; | ||
Abort(ex); | ||
throw; | ||
} | ||
catch (System.StackOverflowException ex) | ||
{ | ||
e = ex; | ||
Abort(ex); | ||
throw; | ||
} | ||
catch (System.Threading.ThreadAbortException ex) | ||
{ | ||
e = ex; | ||
Abort(ex); | ||
#if NETFRAMEWORK | ||
SqlInternalConnection.BestEffortCleanup(bestEffortCleanupTarget); | ||
#endif | ||
throw; | ||
} | ||
catch (Exception ex) | ||
{ | ||
e = ex; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -539,9 +539,6 @@ internal SqlInternalConnectionTds( | |
_parserLock.Wait(canReleaseFromAnyThread: false); | ||
ThreadHasParserLockForClose = true; // In case of error, let ourselves know that we already own the parser lock | ||
|
||
#if NETFRAMEWORK | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did these netcore files have |
||
RuntimeHelpers.PrepareConstrainedRegions(); | ||
#endif | ||
try | ||
{ | ||
_timeout = TimeoutTimer.StartSecondsTimeout(connectionOptions.ConnectTimeout); | ||
|
@@ -573,21 +570,6 @@ internal SqlInternalConnectionTds( | |
} | ||
} | ||
} | ||
catch (System.OutOfMemoryException) | ||
{ | ||
DoomThisConnection(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No more doom on an exception? |
||
throw; | ||
} | ||
catch (System.StackOverflowException) | ||
{ | ||
DoomThisConnection(); | ||
throw; | ||
} | ||
catch (System.Threading.ThreadAbortException) | ||
{ | ||
DoomThisConnection(); | ||
throw; | ||
} | ||
finally | ||
{ | ||
ThreadHasParserLockForClose = false; | ||
|
@@ -2136,39 +2118,18 @@ internal bool GetSessionAndReconnectIfNeeded(SqlConnection parent, int timeout = | |
|
||
try | ||
{ | ||
#if NETFRAMEWORK | ||
RuntimeHelpers.PrepareConstrainedRegions(); | ||
#endif | ||
try | ||
Task reconnectTask = parent.ValidateAndReconnect(() => | ||
{ | ||
Task reconnectTask = parent.ValidateAndReconnect(() => | ||
{ | ||
ThreadHasParserLockForClose = false; | ||
_parserLock.Release(); | ||
releaseConnectionLock = false; | ||
}, timeout); | ||
if (reconnectTask != null) | ||
{ | ||
AsyncHelper.WaitForCompletion(reconnectTask, timeout); | ||
return true; | ||
} | ||
return false; | ||
} | ||
catch (System.OutOfMemoryException) | ||
{ | ||
DoomThisConnection(); | ||
throw; | ||
} | ||
catch (System.StackOverflowException) | ||
{ | ||
DoomThisConnection(); | ||
throw; | ||
} | ||
catch (System.Threading.ThreadAbortException) | ||
ThreadHasParserLockForClose = false; | ||
_parserLock.Release(); | ||
releaseConnectionLock = false; | ||
}, timeout); | ||
if (reconnectTask != null) | ||
{ | ||
DoomThisConnection(); | ||
throw; | ||
AsyncHelper.WaitForCompletion(reconnectTask, timeout); | ||
return true; | ||
} | ||
return false; | ||
} | ||
finally | ||
{ | ||
|
@@ -2475,10 +2436,6 @@ internal bool TryGetFedAuthTokenLocked(SqlFedAuthInfo fedAuthInfo, DbConnectionP | |
// Variable which indicates if we did indeed manage to acquire the lock on the authentication context, to try update it. | ||
bool authenticationContextLocked = false; | ||
|
||
// Prepare CER to ensure the lock on authentication context is released. | ||
#if NETFRAMEWORK | ||
RuntimeHelpers.PrepareConstrainedRegions(); | ||
#endif | ||
try | ||
{ | ||
// Try to obtain a lock on the context. If acquired, this thread got the opportunity to update. | ||
|
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.
Should this catch be calling
_activeConnection.Abort(e)
like the other catches used to?Same with the other 2 below.