You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
should_decrypt=self.e2ee_secretboxisnotNone# and chunk_request.dst_region == self.region
157
-
should_decompress=chunk_header.is_compressed# and chunk_request.dst_region == self.region
158
-
159
-
# wait for space
160
-
# while self.chunk_store.remaining_bytes() < chunk_header.data_len * self.max_pending_chunks:
161
-
#print(
162
-
#f"[receiver:{server_port}]: No remaining space with bytes {self.chunk_store.remaining_bytes()} data len {chunk_header.data_len} max pending {self.max_pending_chunks}, total space {init_space}"
should_decrypt=self.e2ee_secretboxisnotNone# and chunk_request.dst_region == self.region
158
+
should_decompress=chunk_header.is_compressed# and chunk_request.dst_region == self.region
159
+
160
+
# wait for space
161
+
# while self.chunk_store.remaining_bytes() < chunk_header.data_len * self.max_pending_chunks:
162
+
#print(
163
+
# f"[receiver:{server_port}]: No remaining space with bytes {self.chunk_store.remaining_bytes()} data len {chunk_header.data_len} max pending {self.max_pending_chunks}, total space {init_space}"
f"[receiver:{server_port}]:{chunk_header.chunk_id} Decompressing {len(to_write)} bytes to {chunk_received_size_decompressed} bytes"
201
201
)
202
-
203
-
# try to write data until successful
204
-
whileTrue:
205
-
try:
206
-
f.seek(0, 0)
207
-
f.write(to_write)
208
-
f.flush()
209
-
210
-
# check write succeeds
211
-
assertos.path.exists(fpath)
212
-
213
-
# check size
214
-
file_size=os.path.getsize(fpath)
215
-
iffile_size==chunk_header.raw_data_len:
216
-
break
217
-
eliffile_size>=chunk_header.raw_data_len:
218
-
raiseValueError(f"[Gateway] File size {file_size} greater than chunk size {chunk_header.raw_data_len}")
219
-
exceptExceptionase:
220
-
print(e)
221
-
print(
222
-
f"[receiver:{server_port}]: No remaining space with bytes {self.chunk_store.remaining_bytes()} data len {chunk_header.data_len} max pending {self.max_pending_chunks}, total space {init_space}"
223
-
)
224
-
time.sleep(1)
202
+
exceptsocket.errorase:
203
+
print(e)
204
+
# This may have pipeline broken error, if happened then restart receiver.
raiseValueError(f"[Gateway] File size {file_size} greater than chunk size {chunk_header.raw_data_len}")
225
+
exceptExceptionase:
226
+
print(e)
227
+
print(
228
+
f"[receiver:{server_port}]: No remaining space with bytes {self.chunk_store.remaining_bytes()} data len {chunk_header.data_len} max pending {self.max_pending_chunks}, total space {init_space}"
0 commit comments