Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection is hanging when server is down #245

Open
krabishe opened this issue Dec 16, 2015 · 0 comments
Open

Connection is hanging when server is down #245

krabishe opened this issue Dec 16, 2015 · 0 comments

Comments

@krabishe
Copy link

Hi,
thanks for your work. I found out, there is no way to determine that server is down after successful connect.

var connFactory = new ReliableConnectionFactory(new DefaultConnectionFactory(...));
var tsc = new CancellationTokenSource();

using (var conn = connFactory.Get())
{
    foreach (var change in conn.Run(new DbQuery("db").Table<Foo>("table").Changes(), cancellationToken: tsc.Token))
    {
        Console.WriteLine(change.NewValue.Id);
    }
}

After stopping the rethinkdb server these messages appear in logs:

Debug: Received 0 / 8 bytes of packet
Debug: ReadLoop terminated by network exception; this is expected if the connection was closed inten
tionally
Warning: 1 queries were still waiting for responses from a connection that is closing; they'll recei
ve exceptions instead
Debug: InternalRunQuery: beginning process of transmitting query w/ token 2
Debug: InternalRunQuery: acquired write lock for query token 2
Debug: InternalRunQuery: writing query token 2
Information: JSON query: [3]
Debug: Writing packet, 3 bytes
Debug: InternalRunQuery: waiting for response for query token 2

There aren't any exceptions in my code, despite of Warning in log.
Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant