Skip to content

Edge runs semi-regularly failing, on wptserve shutdown, after issues near start-up #61770

Description

@gsnedders

On results_edge_dev/results_edge_stable runs, a serve_forever thread occasionally dies ~1s into the run with a spurious WinError 997 on the shutdown-notification socketpair (from 258.txt):

Exception in thread Thread-1 (serve_forever):
Traceback (most recent call last):
  File "...\Lib\threading.py", line 1082, in _bootstrap_inner
    self._context.run(self.run)
  File "...\Lib\threading.py", line 1024, in run
    self._target(*self._args, **self._kwargs)
  File "...\tools\wptserve\wptserve\server.py", line 280, in serve_forever
    shutdown_read_sock.recv(1)
OSError: [WinError 997] Overlapped I/O operation is in progress

Nothing has called shutdown() at this point — yet the select() loop reports the shutdown_read_sock as readable. serve_forever's finally block closes _shutdown_write_sock, so when shutdown() finally does run at real teardown, its send() hits the already-closed socket and throws, which serve.py logs as CRITICAL:

Process http-local on port 8002:
58:11.02 wptserve CRITICAL Traceback (most recent call last):
  File "...\tools\serve\serve.py", line 1062, in create_daemon
    self.daemon.stop()
  File "...\tools\wptserve\wptserve\server.py", line 995, in stop
    self.httpd.shutdown()
Traceback (most recent call last):
  File "...\tools\wptserve\wptserve\server.py", line 298, in shutdown
    self._shutdown_write_sock.send(b'x')
OSError: [WinError 10038] An operation was attempted on something that is not a socket

Any CRITICAL log line makes wptrunner exit non-zero (exit code 64), so a run that otherwise completed fine still fails outright.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions