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

Timeout parameter > 20 can't wait full time #1674

kuribon1234 opened this Issue Sep 22, 2017 · 1 comment


None yet
2 participants

kuribon1234 commented Sep 22, 2017

I found a bug about Timeout and I have an idea to fix.

Step to reproduce

  1. create connecting C# project at Visual Studio
  2. set 60 or 0 on "Timeout" parameter
  3. start to connect with server

The issue

I expected that application tried to connect with server until setting time.
But, Application could not connect for 60 seconds.
When I set "Timeout" parameter to 0, it could not connect infinity. (0 expects infinity, right?)
In both cases, the connection is broken in 21 seconds, and following error message is displayed.

---Error message---
System.Net.Sockets.SocketException: '接続済みの呼び出し先が一定の時間を過ぎても正しく応答しなかったため、接続できませんでした。または接続済みのホストが応答しなかったため、確立された接続は失敗しました。'
System.Net.Sockets.SocketException:"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

My idea

Application was successfully connected when I used null instead of "error" Ilist which the third parameter in select method of connect function.
Following method in npgsql/src/Npgsql/NpgsqlConnector.cs

Socket.Select(null, write, error, perEndpointTimeout);

I want to send pull request to fix this error part.
I think it is better to discuss with you first before I send pull request, because I develop Npgsql at the first time.
Could you give me your opinion?
Can I delete this error Ilist and use null instead of error in code?
Could you tell me what kind of Exception do you expect to catch?

Further technical details

・Npgsql version:
・PostgreSQL version: 9.6.5-1-windows-x64
・Operating system: Windows 8.1 x64
・Programming Tool: Visual Studio 2017


This comment has been minimized.

Show comment
Hide comment

roji Jun 9, 2018


Sorry for not responding on this, I'll try to take a look in the coming weeks.


roji commented Jun 9, 2018

Sorry for not responding on this, I'll try to take a look in the coming weeks.

@roji roji added this to the 4.0.1 milestone Jun 9, 2018

@roji roji removed this from the 4.0.1 milestone Jun 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment