TSHttpSsnReenable can resume a session on the wrong ET_NET thread
Maintainer thường phản hồi trong vòng 2 ngày
@moonchen đang làm issue này rồi.
Từ ngày 28/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
TSHttpSsnReenable() can resume a session on the wrong network thread. Its fast path checks that the caller is an ET_NET thread, but does not check that it is the session's assigned thread.
Trigger
- A session-start hook pauses a session on its owner thread A.
- A plugin later calls
TSHttpSsnReenable()from another network thread B. - B acquires the session mutex. ATS immediately calls the session handler on B, without returning to A.
- The next session hook runs on B.
A callback from TS_THREAD_POOL_TASK does not trigger this branch: that path already schedules back to the session's owner. The problem is a call from a different network thread.
Reproduction
Use at least two network threads and register two TS_HTTP_SSN_START_HOOK callbacks:
- The first records thread A and returns without reenabling the session.
- Use
TSContScheduleOnThread()to callTSHttpSsnReenable()on B after the first hook returns. - Record the executing thread in the second hook.
Observed on an ATS 11.0.0 debug build; addresses are replaced with A/B:
session first owner=A other=B
session resume owner=A current=B
session second owner=A current=B wrong_thread=1
Confirmed: the second session hook runs on the wrong thread. No ATS core changes were needed. The probe then returns to A before completing session startup; it does not reproduce an HTTP/2 crash.
The same API branch exists in 10.1.2, but that version was not run.
Agreed fix direction
After discussing this with community members, we agreed that work protected by a NetHandler mutex should run on that NetHandler's owning network thread. Acquiring a mutex on another thread does not establish connection ownership.
- Caller is on another thread: compare against the session's exact affinity thread and schedule the callback there with the required locks. This applies even when the caller is another ET_NET thread.
- Caller is already on the owner: preserve synchronous execution with the required locks and the existing lock-failure fallback.
- Task-thread callers remain supported: retain the existing return to the session's owner from
TS_THREAD_POOL_TASK.
TSHttpTxnReenable() already follows the exact-affinity approach. The preferred fix is to enforce it at the session reenable entry point, before session processing can run on the wrong thread. The related NetHandler mutex audit is described in #13743.
Impact
After the hooks finish, session startup runs synchronously. For HTTP/2, startup can immediately process buffered input. This provides a potential route into connection processing on the wrong thread; that consequence was traced in source, not reproduced as a crash. We have not confirmed that this path caused #13358.
Source references and related issues
TSHttpSsnReenable()skips the affinity check when an ET_NET caller acquires the session mutex.TSHttpTxnReenable()already checks the exact owner thread.ProxySession::handle_api_return()callsstart()directly.Http2ClientSession::start()can process buffered input immediately.- #7255 and #7295 addressed session reenable from non-ET_NET threads. This report covers a different ET_NET thread taking the fast path.
Found while investigating #13358 and #13362. We have not identified a plugin in that deployment that triggers this path. The shipped callers examined reenable synchronously. Certifier uses TSVConnReenable(), covered separately in #13743.
- Ngôn ngữ chính
- C++
- Star
- 2k
- Fork
- 903
- Merge trung bình
- 4 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 135
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOCó thể đã có người làm @NginxL đã nhận hôm nay. Đang mởBug Good First Issue IOBuffer Network
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#14220 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
MallocAllocator does not check for allocation failureCó thể đã có người làm @umrndem đã nhận hôm nay. Đang mởBug Core Good First Issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#14218 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
THREAD_ALLOC dereferences a null thread while THREAD_FREE falls back to the global allocatorĐang mởBug Event System Threads
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#14217 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodCó thể đã có người làm @rajeetvk đã nhận 1 ngày trước. Đang mởBug Event System Good First Issue TS API
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/trafficserver#14214 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
HostDBContinuation::init memsets a polymorphic ActionCó thể đã có người làm @ANMOLSCRIPT đã nhận hôm nay. Đang mởBug Good First Issue HostDB
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/trafficserver#14204 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/trafficserver
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug compatibility difficulty:easy prio:normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NatronGitHub/openfx-misc#524 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[内容提案] 现在C++模块的CMake支持有更新,需要进行同步Đang mởdocumentation enhancement help wanted P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openscad/openscad#7360 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày