Description
When running on Linux, calling close() on a SocketServer does not correctly unblock the thread blocked on accept() throwing a SocketException as expected. This results in the server thread remaining blocked indefinitely.
Expected Behavior
When server.close() is called, any threads blocked in accept() should be interrupted with a SocketException.
Actual Behavior
The accept() call does not return raising an exception after server.close() is called. The thread running the accept remains blocked.
Steps to Reproduce
You can reproduce the issue by running the failing test provided in this repository.
This issue is also consistently reproduced in CI. You can see a failing test run on Ubuntu here.
Note: the buggy behaviour is not limited to Ubuntu, rather Linux-specific.