Skip to content

Add connection_timeout parameter #115

Closed

Description

@bofm

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.

Activity

  1. Totktonada commented on Mar 5, 2019

    @Totktonada
    Contributor

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

  2. changed the title [-]socket_timeout is ignored when the connection is filtered[/-] [+]Add connection_timeout parameter[/+] on Mar 5, 2019
  3. added
    featureA new functionality
    and removed
    bugSomething isn't working
    on Mar 5, 2019
  4. added a commit that references this issue on Mar 5, 2019
    b17d96e
  5. added a commit that references this issue on Mar 5, 2019
    118d34e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureA new functionality

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions