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

kernel Cannot read, host process disconnected: {hostname} 1234 spid: 4567 #199

Open
thancock14 opened this issue Sep 16, 2020 · 3 comments

Comments

@thancock14
Copy link

My sybase admins are reporting a poorly disconnected dbconnection.

I am using
Linq2db version 2.9.4 (sybasemanaged provider)
AdoNetCore.AseClient 0.16.0
.net core 2.2

I'm opening a connection the same way I did with the .net framework sybase official driver.
and I'm disposing of it in a using statement (and passing the connection to linq2db)

the Sybase dba's are simply telling me the disconnect is not happening. So they are getting massive amount of logs or something.
I'm seeing zero exceptions on my side, and when I step through the code the connection state is Open before dispose is called and is Closed after calling Dispose()

any suggestions?

@senseibaka
Copy link
Collaborator

Hi @thancock14,

One thing to check is connection pooling, which keeps network connections open for reuse in subsequent queries.
By default it is enabled, to disable it include Pooling=False; in your connection string.

However, I'd advise keeping pooling enabled -- the performance benefit of not having to re-establish connections is significant

Cheers

@thancock14
Copy link
Author

thancock14 commented Sep 22, 2020

Yes, I agree I think the pooling is not something to turn off, but it appears that's not exactly the issue here. It could possibly the tcp keepalive process? Is the disposing of the connection not cleaning up the connection to the database correctly?
The dbo's are referring to the issue as a poor Disconnect or the absence of a disconnect.
They described the error as the same error that happens when your process dies without cleaning up it's connections with the db.
So I'm not seeing any errors client side, but they see errors server side

When I switched back to .net framework 471 and the official sybase driver dll, the server side errors went away. Same connection string and code

@senseibaka
Copy link
Collaborator

Ah yes I might have misread the issue.

This driver doesn't send any sort of "close connection"/"logout" kind of message to the server prior to closing the socket, so that might be the cause.

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

2 participants