Document member files audit findings and verified fixes

This commit is contained in:
evgeny committed 2026-10-24 18:47:06 +02:00
1 parent ffbfd0ffbf
commit ed9d294486
3 files changed
+151 -5

No files matched your search

+7 -1
View File
@@ -191,7 +191,11 @@ static void mf_pending_pump(void* arg) {
struct mf_pending* p = arg; p->pump = NULL;
if (p->files->closing) return;
if (p->retry) { uasync_cancel_timeout(p->files->inst->ua, p->retry); p->retry = NULL; }
if (get_time_tb() - p->started >= MF_REPLAY_TB) { mf_pending_finish(p, NULL, MF_TIMEOUT); return; }
if (get_time_tb() - p->started >= MF_REPLAY_TB) {
DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "member_files: request expired before send id=%llu cmd=%s",
(unsigned long long)p->request.request_id, mf_command_text(p->request.command));
mf_pending_finish(p, NULL, MF_TIMEOUT); return;
}
int rc = mf_send(p->files, p->group, p->server, &p->request);
if (!rc) { p->sent = get_time_tb(); p->retry_at = 0; }
else if (rc > 0) etcp_router_on_send_ready(p->files->inst, p->group, p->server, ETCP_RT_ID_MEMBER_FILES,
@@ -438,6 +442,8 @@ static void mf_dispatch(struct member_files* f, uint64_t group, uint64_t peer, c
}
if (!member_files_member(f->inst, group, peer, 1)) { m.status = MF_ACCESS_DENIED; m.data_len = 0; }
if (m.status == MF_BUSY && (m.command == MF_COMMIT || (m.command >= MF_MKDIR && m.command <= MF_REMOVE_PATH))) {
if (m.cursor > MF_REPLAY_TB) DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "member_files: invalid busy hint id=%llu delay_tb=%llu; using5s",
(unsigned long long)m.request_id, (unsigned long long)m.cursor);
uint64_t now = get_time_tb(), delay = m.cursor && m.cursor <= MF_REPLAY_TB ? m.cursor : 50000;
p->retry_at = now + delay;
p->sent = now;