Commit 7a34d753 authored by mgravell's avatar mgravell

fix #1342 - avoid race condition in exception processing

parent 92125519
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
- add: support for `HSTRLEN` (#1241 via eitanhs) - add: support for `HSTRLEN` (#1241 via eitanhs)
- add: `GeoRadiusResult` is now mockable (#1175 via firenero) - add: `GeoRadiusResult` is now mockable (#1175 via firenero)
- fix: various documentation fixes (#1162, #1135, #1203, #1240, #1245, #1159, #1311, #1339) - fix: various documentation fixes (#1162, #1135, #1203, #1240, #1245, #1159, #1311, #1339)
- fix: rare race-condition around exception data (#1342)
## 2.0.600 ## 2.0.600
......
...@@ -81,15 +81,16 @@ internal Exception LastException ...@@ -81,15 +81,16 @@ internal Exception LastException
{ {
get get
{ {
var tmp1 = interactive; var snapshot = interactive;
var tmp2 = subscription; var subEx = subscription?.LastException;
var subExData = subEx?.Data;
//check if subscription endpoint has a better lastexception //check if subscription endpoint has a better lastexception
if (tmp2?.LastException != null && tmp2.LastException.Data.Contains("Redis-FailureType") && !tmp2.LastException.Data["Redis-FailureType"].ToString().Equals(nameof(ConnectionFailureType.UnableToConnect))) if (subExData != null && subExData.Contains("Redis-FailureType") && subExData["Redis-FailureType"]?.ToString() != nameof(ConnectionFailureType.UnableToConnect))
{ {
return tmp2.LastException; return subEx;
} }
return tmp1?.LastException; return snapshot?.LastException;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment