fix: wait for the early-delete ACK with an extended deadline
The receiver performs the whole bounded deletion walk (up to MAX_SERVER_DELETE_COUNT unlinks) before answering the delete-before/during manifest, so its STATUS_OK reply can take far longer than the default 60 s per-message receive window. Waiting with the default would make the sender abort AFTER the deletion had already committed on the receiver. Add a timed receive variant (receive_status_timed / protocol_receive_n_data_timed) and use it for the early-manifest ACK with a 1 h explicit deadline; connection errors and EOF still abort immediately.
This commit is contained in:
@@ -112,5 +112,10 @@ bool send_int(int file_descriptor, int data);
|
||||
bool receive_int(int file_descriptor, int* data);
|
||||
bool send_status(int file_descriptor, Status status);
|
||||
bool receive_status(int file_descriptor, Status* status);
|
||||
/* receive_status with an explicit per-message deadline in seconds, instead of
|
||||
the default RECEIVE_TIMEOUT_SEC. A reply that may legitimately take longer
|
||||
(e.g. the early-delete ACK after a large receiver-side deletion) must use
|
||||
this so the sender does not abort after the deletion already committed. */
|
||||
bool receive_status_timed(int file_descriptor, Status* status, int timeout_sec);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user