merge: task/n17-probe 合入 v2-on-ui

任务 n17(1 个提交)经 task-worktree 回收:
- fix(网络): 主动拆会话登记即返——drop 路径不再占用 netTask(登记簿 N-17 收口)
This commit is contained in:
2026-10-25 10:32:25 +08:00
6 changed files with 108 additions and 26 deletions
+4 -2
View File
@@ -550,8 +550,10 @@ static void tc_240_drop_conn_branches(void)
CHECK(g_peers.pending_settle_calls == 1 && g_peers.send_cancel_calls == 1,
"TC-NETSOCK-240e both pending tables are ended before dropping the session (with notification)");
CHECK(g_fxchip.rst_begin_calls == 1,
"TC-NETSOCK-240f teardown uses sock_reset deterministic draining, not close plus blind waiting");
CHECK(g_peers.listener_settle_calls == 1 &&
g_peers.last_settle_level == (int)NET_LISTENER_SETTLE_QUARANTINE &&
g_fxchip.rst_begin_calls == 0,
"TC-NETSOCK-240f listener teardown is REGISTERED for the tick machine (QUARANTINE settle + REQ_DROP) - the handler starts no reset machine and never waits (N-17)");
CHECK(g_peers.listener_req_calls == 1 &&
g_peers.last_req_reason == (int)NET_LISTENER_REQ_DROP,
"TC-NETSOCK-240g listener-type fd registers REQ_DROP after the drop (rebuild belongs to the listener layer)");
+18 -3
View File
@@ -274,7 +274,8 @@ static void tc_320_close_two_paths(void)
reset_all();
}
/* TC-NETSOCK-321 drop_conn 用 QUARANTINE(异常释放语义),且不动监听簿记 */
/* TC-NETSOCK-321 drop_conn:监听型 = 登记式(settle QUARANTINE + REQ_DROP,
* N-17 起 netTask 零占用);非监听 client fd 保留同步排渣;两者都不动监听簿记 */
static void tc_321_drop_conn_settle(void)
{
int fd;
@@ -287,8 +288,11 @@ static void tc_321_drop_conn_settle(void)
g_fake.cached_open[fd] = CH395F_SOCKET_OPEN;
CHECK(net_drop_conn(fd) == 0, "TC-NETSOCK-321a drop_conn succeeds");
CHECK(g_fxchip.rst_begin_calls == 1 && g_fx.rst_mode[fd] == 1U,
"TC-NETSOCK-321b session drop uses QUARANTINE with a 400ms floor (TRAP-NET-18 abnormal release, graded against close)");
CHECK(g_peers.listener_settle_calls == 1 && g_peers.last_settle_fd == fd &&
g_peers.last_settle_level == (int)NET_LISTENER_SETTLE_QUARANTINE,
"TC-NETSOCK-321b listener fd: abnormal-release isolation REGISTERED for the tick machine (TRAP-NET-18 QUARANTINE semantics survive, executed by net_listener_tick)");
CHECK(g_fxchip.rst_begin_calls == 0 && g_ns_error_count == 0,
"TC-NETSOCK-321b2 N-17: the handler starts no synchronous reset and logs nothing - netTask keeps its ~1ms beat");
CHECK(s_net_socks[fd].lost_conn_seen == 0U,
"TC-NETSOCK-321c new session start: the missed-event debounce counter is cleared (N-30)");
CHECK(s_net_socks[fd].local_port == 2404U && s_net_socks[fd].auto_relisten == 1U &&
@@ -300,6 +304,17 @@ static void tc_321_drop_conn_settle(void)
CHECK(s_net_socks[fd].readable == 0U && s_net_socks[fd].state == NET_SOCK_STATE_CLOSED,
"TC-NETSOCK-321f session bookkeeping closes out: clear readable and move to CLOSED");
reset_all();
/* 非监听 client fd:无监听可保,同步排渣形态原样保留(N-17 只改监听型) */
bring_up();
fd = mk_established(NET_SOCK_STREAM);
g_fake.cached_open[fd] = CH395F_SOCKET_OPEN;
CHECK(net_drop_conn(fd) == 0, "TC-NETSOCK-321g client-fd drop still succeeds");
CHECK(g_peers.listener_settle_calls == 0 && g_peers.listener_req_calls == 0,
"TC-NETSOCK-321h client fd registers no settle and no REQ_DROP: nothing to rebuild");
CHECK(g_fxchip.rst_begin_calls == 1 && g_fx.rst_mode[fd] == 1U,
"TC-NETSOCK-321i client fd keeps the synchronous QUARANTINE close-out (bounded 600ms, legacy shape)");
reset_all();
}
/* TC-NETSOCK-322 close 前必先把挂起结算掉,再动芯片(顺序不可换) */
+14 -2
View File
@@ -554,16 +554,28 @@ static void tc_460_reset_sync_timeout_bound(void)
"TC-NETSOCK-460d the slot is released even on timeout (a chip state must not jam the local fd table)");
reset_all();
/* drop_conn 同一条超时线 */
/* N-17:监听型 fd 的 drop 不再走复位等待线——登记即返;即便芯片永不落回
* CLOSED 也与本调用无关(排渣与等待归 net_listener_tick 的隔离机) */
bring_up();
fd = mk_established(NET_SOCK_STREAM);
s_net_socks[fd].auto_relisten = 1U;
g_fake.cached_open[fd] = CH395F_SOCKET_OPEN;
g_fx.rst_keep_open[fd] = 1U;
t_before = g_ns_tick;
CHECK(net_drop_conn(fd) == 0 && (g_ns_tick - t_before) <= 20U &&
g_ns_error_count == 0 && g_peers.listener_settle_calls == 1,
"TC-NETSOCK-460e listener drop returns registered and off the beat budget: no 600ms close-out, no [ERR] line, isolation armed (N-17)");
reset_all();
/* 非监听 client fd 保留旧超时线(同步、600ms 封顶、留痕) */
bring_up();
fd = mk_established(NET_SOCK_STREAM);
g_fake.cached_open[fd] = CH395F_SOCKET_OPEN;
g_fx.rst_keep_open[fd] = 1U;
t_before = g_ns_tick;
CHECK(net_drop_conn(fd) == 0 && (g_ns_tick - t_before) <= 700U &&
g_ns_error_count >= 1,
"TC-NETSOCK-460e drop_conn takes the same bounded close-out and logs it too");
"TC-NETSOCK-460f client-fd drop keeps the same bounded close-out as net_close and logs it too");
reset_all();
}