The AcceptingChannel<StreamConnection> created by Endpoint.getConnectionProviderInterface(...).createServer(...) does not synchronously close down the underlying socket as part of a call to its close() method. The result is if the application wishes to create a new server there is a race between that creation and the async close of the previous server.
I believe this race is the cause of the intermittent WildFly Core testsuite failures discussed in
The socket is not closed synchronously because the ServerSocketChannel impl of close() does not close the socket if there are any registered keys. Debugging shows the socket is not closed until this stack happens:
That worker thread is not under the control of the application except by closing down the endpoint, which means unless the app is closing down the endpoint along with stopping the server there's a race.
In a moment I'll link a reproducer.