Skip to content

Add connection_timeout parameter #115

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

Closed
bofm opened this issue Mar 4, 2019 · 1 comment
Closed

Add connection_timeout parameter #115

bofm opened this issue Mar 4, 2019 · 1 comment
Assignees
Labels
feature A new functionality

Comments

@bofm
Copy link

bofm commented Mar 4, 2019

When a remote server does not respond, the connection times out longer than Connection. socket_timeout.

nmap -Pn 10.0.0.1 -p 3301

Starting Nmap 7.50 ( https://nmap.org ) at 2019-03-04 18:02 MSK
Nmap scan report for 10.0.0.1
Host is up.

PORT     STATE    SERVICE
3301/tcp filtered unknown

Nmap done: 1 IP address (1 host up) scanned in 3.92 seconds
time python -c '
import tarantool
try:
    tarantool.Connection("10.0.0.1", 3301, socket_timeout=1, reconnect_max_attempts=0)
except Exception as e:
    print(e.__class__.__name__, e)
'

NetworkError (60, 'Operation timed out')
python -c   0.08s user 0.03s system 0% cpu 1:20.06 total

The problem is here

# It is important to set socket timeout *after* connection.

Expected behavior:

NetworkError should be raised after Connection.socket_timeout has passed.

@kyukhin kyukhin added the bug Something isn't working label Mar 4, 2019
@Totktonada
Copy link
Member

It is not really a bug, but the feature request to add the connection_timeout parameter.

@Totktonada Totktonada changed the title socket_timeout is ignored when the connection is filtered Add connection_timeout parameter Mar 5, 2019
@Totktonada Totktonada added feature A new functionality and removed bug Something isn't working labels Mar 5, 2019
Totktonada added a commit that referenced this issue Mar 5, 2019
Totktonada added a commit that referenced this issue Mar 5, 2019
Totktonada added a commit that referenced this issue Mar 14, 2019
It is already set in connect_tcp() or connect_unix().

Follows up #115.
Totktonada added a commit that referenced this issue Mar 14, 2019
It is already set in connect_tcp() or connect_unix().

Follows up #115.
Totktonada added a commit that referenced this issue Mar 18, 2019
It is already set in connect_tcp() or connect_unix().

Follows up #115.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

No branches or pull requests

3 participants