Event Store Client v 3.0.1 hangs on read/write attempt

Hi,

I’m trying to switch to version 3.0.1 (from 2.0.1) and run into issues with async Client.

it just hangs on an attempt to read or write. Seems like similar issue: https://groups.google.com/forum/#!topic/event-store/mdxbAZdOCxA but with older version.

Was working fine with previous version (was using non async api)

[Test]
public async Task Test()
{
    var con = EventStoreConnection.Create(ConnectionSettings.Create()
    .FailOnNoServerResponse()
        .KeepReconnecting()
        .KeepRetrying()
        .SetDefaultUserCredentials(new UserCredentials("admin", "changeit")),
        new IPEndPoint(IPAddress.Loopback, 1113));

    await con.ConnectAsync();

    //hangs on this line:
    var slice = await con.ReadStreamEventsForwardAsync("devicetest4-123", 0, 100, false);

    slice.Status.Should().Be(SliceReadStatus.Success);
    slice.Events.Count().Should().BeGreaterThan(0);

   
    con.Close();
}

Also have tried:

var slice = con.ReadStreamEventsForwardAsync(“devicetest4-123”, 0, 100, false).Result;


and

await Task.Run(
async () =>
{
slice = await con.ReadStreamEventsForwardAsync(“devicetest4-123”, 0, 100, false);

});

Same happens on writing attempt.

Is this a known issue, or it is me missing something silly, like default port has changed?

After removing .KeepReconnecting().KeepRetrying() I now got it crashing with
ConnectionClosedException : Connection ‘ES-ddf397af-95ea-4111-aa63-750f31b98ceb’ was closed.

Solved.

Problem was with IP config. For unknown reason EventStore got installed to 169.254.80.80 instead of default 127.0.0.1, so IPAddress.Loopback didn’t work. Web UI however is running on 127.0.0.1:2113, so I’m at loss of why it has defaulted to random IP for External IP.

This just happened to me too. I spent >4 hours going round and round trying to figure out why the code was blocking when calling .Result (obviously it was deadlocking, right?) just to finally find this thread and realize I was hardcoding to 127.0.0.1 when the GES was bound to a different IP.

I may be the only thinking it but I’ll say it. I hate async/await. Even when it’s not the actual problem, it’s still a f***cking debug nightmare. I’m a bit sad that ES provides only an async interface.

Chris.

Try using a logger, everything that happens in client api is logged. You would see this almost immediately eg useconsolelogger().enableverboselogging()

Or try not automatically reconnecting and retrying (you will get your error on the wait then)