Skip to content

LockRecursionException in ThreadSafeList when disconnecting #25

@ianrandell-sh

Description

@ianrandell-sh

Hi there - first of all thanks for these brilliant libraries.

I'm getting the following exception when disconnecting as part of handling a connection error (a 403:denied_by_security_policy:create_denied in my case since the channel doesn't exist):

System.Threading.LockRecursionException

"Recursive read lock acquisitions not allowed in this mode"

at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
at System.Collections.Generic.ThreadSafeList`1.<GetEnumerator>d__18.MoveNext() in C:\projects\cometd-netcore\src\CometD.NetCore\Internal\ThreadSafeList.cs:line 201
at CometD.NetCore.Common.AbstractClientSession.ExtendSend(IMutableMessage message) in C:\projects\cometd-netcore\src\CometD.NetCore\Common\AbstractClientSession.cs:line 214
at CometD.NetCore.Client.BayeuxClient.BayeuxClientState.Send(ITransportListener listener, IList`1 messages, Int32 clientTimeout) in C:\projects\cometd-netcore\src\CometD.NetCore\Client\BayeuxClient.cs:line 1003
at CometD.NetCore.Client.BayeuxClient.BayeuxClientState.Send(ITransportListener listener, IMutableMessage message, Int32 clientTimeout) in C:\projects\cometd-netcore\src\CometD.NetCore\Client\BayeuxClient.cs:line 987
at CometD.NetCore.Client.BayeuxClient.DisconnectingState.Execute() in C:\projects\cometd-netcore\src\CometD.NetCore\Client\BayeuxClient.cs:line 1245
at CometD.NetCore.Client.BayeuxClient.UpdateBayeuxClientState(BayeuxClientStateUpdater_createDelegate create, BayeuxClientStateUpdater_postCreateDelegate postCreate) in C:\projects\cometd-netcore\src\CometD.NetCore\Client\BayeuxClient.cs:line 727
at CometD.NetCore.Client.BayeuxClient.UpdateBayeuxClientState(BayeuxClientStateUpdater_createDelegate create) in C:\projects\cometd-netcore\src\CometD.NetCore\Client\BayeuxClient.cs:line 690
at CometD.NetCore.Client.BayeuxClient.Disconnect() in C:\projects\cometd-netcore\src\CometD.NetCore\Client\BayeuxClient.cs:line 143

What I'm using:

  • a slightly modified version of ResilientStreamingClient from your CometD.NetCore.Salesforce repo
  • version 2.0.6 of this nuget (v2.0.7 looks like no code changes)
  • .net core 3.1 on Windows 10

My Disconnect() method in my ResilientStreamingClient is unchanged from your repo version.

Any help appreciated. I'll continue troubleshooting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions