rare System.IndexOutOfRangeException when reusing EncodedConnection object #713
shimr12
announced in
Announcements
Replies: 1 comment
-
Perhaps a ConcurrentDictionary should be used instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
I use a very small pool of
EncodedConnection
s and share them between threads.I saw here a mention that
EncodedConnection
is thread safe so my usage is normal.I rarely get a
System.IndexOutOfRangeException
when trying to callEncodedConnection.SubscribeAsync
.example stacktrace:
calling
Dictionary.Add
shouldn't raiseSystem.IndexOutOfRangeException
normally.usually it means your using it from multiple threads without locking.
I took a glance at the code here and it confirms it.
if
EncodedConnection
supposed to be thread-safe this is a bug.Beta Was this translation helpful? Give feedback.
All reactions