You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When reconnecting a subscriber the server/client, the handshake stops prematurely.
To Reproduce
Start the server.
Start the client with only one persistent subscriber. There should be logic to reconnect the subscriber (dispose and try to connect a new instance of the same subscriber) if the connection is dropped.
Killed the server a couple of times in which the subscriber reconnects.
In the last reconnection attempt, the client seemed to believe it's connected (no exception was thrown). However, the subscription from the server's point of view does not have the client connected to it and therefore no messages are flowing to the client.
This happens only if a cancellation token is not passed to the EventStorePersistentSubscriptionsClient.SubscribeAsync call.
Expected behavior
Regardless of the optional cancellation token, I'd expect the call to EventStorePersistentSubscriptionsClient.SubscribeAsync to yield either a value or to throw.
Actual behavior
Connection hangs with unfinished handshake.
Config/Logs/Screenshots
static async Task ConnectPersistentSubscriber(Action<PersistentSubscription, SubscriptionDroppedReason, Exception> onSubscriptionDropped)
{
var eventStoreClientSettings = EventStoreClientSettings.Create("esdb://admin:changeit@127.0.0.1:2113?tls=true&tlsVerifyCert=false");
eventStoreClientSettings.LoggerFactory = LoggerFactory.Create(builder => {
builder.AddSerilog();
});
var eventStoreClient = new EventStorePersistentSubscriptionsClient(eventStoreClientSettings);
try
{
await eventStoreClient.SubscribeAsync(
"$id-id12334",
"placeholder",
delegate { return Task.CompletedTask; },
(s, r, ex) =>
{
eventStoreClient.Dispose();
onSubscriptionDropped(s, r, ex);
}
// Have to pass a cancellation token otherwise the call to "SubscribeAsync" will eventually hang with an incomplete handshake.
,cancellationToken: new CancellationTokenSource(2000).Token
);
}
catch
{
eventStoreClient.Dispose();
throw;
}
}
Describe the bug
When reconnecting a subscriber the server/client, the handshake stops prematurely.
To Reproduce
This happens only if a cancellation token is not passed to the EventStorePersistentSubscriptionsClient.SubscribeAsync call.
Expected behavior
Regardless of the optional cancellation token, I'd expect the call to EventStorePersistentSubscriptionsClient.SubscribeAsync to yield either a value or to throw.
Actual behavior
Connection hangs with unfinished handshake.
Config/Logs/Screenshots
Normal Connection:
Bugged Connection:
EventStore details
EventStore server version: 21.6.0
Operating system: Windows Server 2016
EventStore client version: 20.10.0, 21.2.0
Originally from support ticket: 109806
The text was updated successfully, but these errors were encountered: