portal 3.1.9__tar.gz → 3.1.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {portal-3.1.9/portal.egg-info → portal-3.1.10}/PKG-INFO +1 -1
- {portal-3.1.9 → portal-3.1.10}/portal/__init__.py +1 -1
- {portal-3.1.9 → portal-3.1.10}/portal/server_socket.py +9 -4
- {portal-3.1.9 → portal-3.1.10/portal.egg-info}/PKG-INFO +1 -1
- {portal-3.1.9 → portal-3.1.10}/tests/test_batching.py +2 -1
- {portal-3.1.9 → portal-3.1.10}/LICENSE +0 -0
- {portal-3.1.9 → portal-3.1.10}/MANIFEST.in +0 -0
- {portal-3.1.9 → portal-3.1.10}/README.md +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/batching.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/buffers.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/client.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/client_socket.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/contextlib.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/packlib.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/poollib.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/process.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/server.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/sharray.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/thread.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal/utils.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal.egg-info/SOURCES.txt +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal.egg-info/dependency_links.txt +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal.egg-info/requires.txt +0 -0
- {portal-3.1.9 → portal-3.1.10}/portal.egg-info/top_level.txt +0 -0
- {portal-3.1.9 → portal-3.1.10}/pyproject.toml +0 -0
- {portal-3.1.9 → portal-3.1.10}/requirements.txt +0 -0
- {portal-3.1.9 → portal-3.1.10}/setup.cfg +0 -0
- {portal-3.1.9 → portal-3.1.10}/setup.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_client.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_errfile.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_pack.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_process.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_server.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_socket.py +0 -0
- {portal-3.1.9 → portal-3.1.10}/tests/test_thread.py +0 -0
@@ -141,8 +141,11 @@ class ServerSocket:
|
|
141
141
|
conn.recvbuf = buffers.RecvBuffer(maxsize=self.options.max_msg_size)
|
142
142
|
try:
|
143
143
|
conn.recvbuf.recv(conn.sock)
|
144
|
-
except
|
145
|
-
|
144
|
+
except OSError as e:
|
145
|
+
# For example:
|
146
|
+
# - ConnectionResetError
|
147
|
+
# - TimeoutError: [Errno 110] Connection timed out
|
148
|
+
self._disconnect(conn, e)
|
146
149
|
return
|
147
150
|
if conn.recvbuf.done():
|
148
151
|
if self.recvq.qsize() > self.options.max_recv_queue:
|
@@ -150,8 +153,10 @@ class ServerSocket:
|
|
150
153
|
self.recvq.put((conn.addr, conn.recvbuf.result()))
|
151
154
|
conn.recvbuf = None
|
152
155
|
|
153
|
-
def _disconnect(self, conn):
|
154
|
-
|
156
|
+
def _disconnect(self, conn, e):
|
157
|
+
detail = f'{type(e).__name__}'
|
158
|
+
detail = f'{detail}: {e}' if str(e) else detail
|
159
|
+
self._log(f'Closed connection to {conn.addr[0]}:{conn.addr[1]} ({detail})')
|
155
160
|
conn = self.conns.pop(conn.addr)
|
156
161
|
if conn.sendbufs:
|
157
162
|
count = len(conn.sendbufs)
|
@@ -110,7 +110,8 @@ class TestBatching:
|
|
110
110
|
client.close()
|
111
111
|
server.close()
|
112
112
|
|
113
|
-
|
113
|
+
@pytest.mark.parametrize('repeat', range(5))
|
114
|
+
def test_shape_mismatch(self, repeat):
|
114
115
|
port = portal.free_port()
|
115
116
|
server = portal.BatchServer(port, errors=False)
|
116
117
|
server.bind('fn', lambda x: x, batch=2)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|