I turned on logging, and the moment I attempt to connect from the second python process using the ports the first process uses, the first process terminal window shows: Closing down callback connection
An error occurred while trying to start the callback server (
127.0.0.1:25334)
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2207, in start
self.server_socket.bind((self.address, self.port))
OSError: [Errno 98] Address already in use
Exception while shutting down a socket
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2207, in start
self.server_socket.bind((self.address, self.port))
OSError: [Errno 98] Address already in use
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 1894, in start_callback_server
self._callback_server.start()
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2216, in start
raise Py4JNetworkError(msg, e)
py4j.protocol.Py4JNetworkError: An error occurred while trying to start the callback server (
127.0.0.1:25334)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 498, in quiet_shutdown
socket_instance.shutdown(socket.SHUT_RDWR)
OSError: [Errno 9] Bad file descriptor
Callback Server Shutting Down
Exception while shutting down a socket
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2207, in start
self.server_socket.bind((self.address, self.port))
OSError: [Errno 98] Address already in use
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 1894, in start_callback_server
self._callback_server.start()
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2216, in start
raise Py4JNetworkError(msg, e)
py4j.protocol.Py4JNetworkError: An error occurred while trying to start the callback server (
127.0.0.1:25334)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 498, in quiet_shutdown
socket_instance.shutdown(socket.SHUT_RDWR)
OSError: [Errno 107] Transport endpoint is not connected
Exception while shutting down callback server
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2207, in start
self.server_socket.bind((self.address, self.port))
OSError: [Errno 98] Address already in use
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 1894, in start_callback_server
self._callback_server.start()
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2216, in start
raise Py4JNetworkError(msg, e)
py4j.protocol.Py4JNetworkError: An error occurred while trying to start the callback server (
127.0.0.1:25334)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 1987, in shutdown_callback_server
self._callback_server.shutdown()
File "/home/jan/.local/lib/python3.8/site-packages/py4j/java_gateway.py", line 2340, in shutdown
self.thread.join()
AttributeError: 'CallbackServer' object has no attribute 'thread'
Right after these messages the terminal continues showing output from the "except" of my python script: