Skip to content

(Python?) SSL handshake seems to be time-limited, CI tests rarely time out on busy workers #3401

@jimklimov

Description

@jimklimov

I saw timestamps around the test suggest a 10 or 20 second range, maybe it is part of that system being busy that an e.g. 5-second timeout is buffered by a lot of time waiting for CPU after/before time-stamped report lines.

================================
Wed Apr  8 16:20:20 UTC 2026 [INFO] [testcase_sandbox_python_with_credentials] Call Python module test suite: PyNUT (NUT Python bindings) with login credentials
Wed Apr  8 16:20:20 UTC 2026 [INFO] Adding client-side (Open)SSL config to python env to talk to our NSS-capable upsd
PyNUTClient test...
[DEBUG] Class initialization...
[DEBUG]  -> Host  = 127.0.0.1 (port 35039, timeout 5.0)
[DEBUG]  -> Login = 'admin' / 'mypass'
[DEBUG]  -> SSL   = True (force: True, verify: True)
[DEBUG] Creating SSL context
[DEBUG] SSL context created
[DEBUG] Connecting to host
[DEBUG] Requesting STARTTLS
[DEBUG] STARTTLS accepted, wrapping socket
EXCEPTION during initialization: _ssl.c:989: The handshake operation timed out
Traceback (most recent call last):
  File "/tmp/jenkins-swarm/jenkins-nutci/nut_nut_PR-3399@2/scripts/python/module/test_nutclient.py", line 35, in <module>
    nut    = PyNUT.PyNUTClient( login=NUT_USER, password=NUT_PASS, debug=NUT_DEBUG, host=NUT_HOST, port=NUT_PORT,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/jenkins-swarm/jenkins-nutci/nut_nut_PR-3399@2/scripts/python/module/PyNUT.py", line 174, in __init__
    self.__connect()
  File "/tmp/jenkins-swarm/jenkins-nutci/nut_nut_PR-3399@2/scripts/python/module/PyNUT.py", line 225, in __connect
    self.__srv_handler = self.__ssl_context.wrap_socket(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1104, in _create
    self.do_handshake()
  File "/usr/lib/python3.11/ssl.py", line 1382, in do_handshake
    self._sslobj.do_handshake()
TimeoutError: _ssl.c:989: The handshake operation timed out
Wed Apr  8 16:20:29 UTC 2026 [ERROR] [testcase_sandbox_python_with_credentials] PyNUT complained, check above

When I experimented with timeouts between C client and upsd, minute-long delays on client side did not break off the server side, I think. So probably the time-limited handshake is in Python SSL library...

This does however pop up with NSS tests (for the few times this was seen at all), which so far should only impact the server side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIEntries related to continuous integration infrastructure (here CI = tools + scripts + recipes)SSL/NSSIssues and PRs about SSL, TLS and other crypto-related mattersimpacts-release-2.8.5Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks)python

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions