DiagsLogContinuation and MemoryLimit are scheduled on ET_TASK before ET_TASK is registered
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- backend, performance
Research direction
Read src/traffic_server/traffic_server.cc around the scheduling calls near line 2363 and tasksProcessor.register_event_type() near line 2432, then check the ET_TASK initialization in src/iocore/eventsystem/Tasks.cc. Move the two periodic schedules until ET_TASK has its registered value, or register it before eventProcessor.start. Done means both continuations run on task threads; build and run the relevant startup checks.
Written by the indexing model from the issue text.
Description
ET_TASK starts out equal to ET_CALL (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/iocore/eventsystem/Tasks.cc#L28) and only gets its own value when tasksProcessor.register_event_type() runs (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/iocore/eventsystem/Tasks.cc#L31-L35), which main does at https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/traffic_server/traffic_server.cc#L2432.
Before that, right after eventProcessor.start, main schedules two periodic continuations on ET_TASK:
DiagsLogContinuation, every second (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/traffic_server/traffic_server.cc#L2363)MemoryLimit, every 10 seconds whenproxy.config.memory.max_usageis set (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/traffic_server/traffic_server.cc#L2369)
schedule_every reads the event type at call time, so both are placed on an ET_CALL (net) thread, and a periodic Event stays on the thread it was scheduled on. They run on a net thread for the life of the process instead of on a task thread. DiagsLogContinuation checks and rolls diags.log and traffic.out, which is blocking file I/O on a net thread.
Suggested fix: schedule these after tasksProcessor.register_event_type() (or register ET_TASK before eventProcessor.start).
generated with Claude Opus 5.5 by Josiah VanderZee
- Dominant language
- C++
- Stars
- 2k
- Forks
- 903
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 135
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOPossibly taken @NginxL claimed this today. OpenBug Good First Issue IOBuffer Network
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/trafficserver#14220 ·
Maintainers usually reply within 2 days
-
MallocAllocator does not check for allocation failurePossibly taken @umrndem claimed this today. OpenBug Core Good First Issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/trafficserver#14218 · 2 comments ·
Maintainers usually reply within 2 days
-
Bug Event System Threads
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/trafficserver#14217 ·
Maintainers usually reply within 2 days
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodPossibly taken @rajeetvk claimed this 1 day ago. OpenBug Event System Good First Issue TS API
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/trafficserver#14214 · 1 comment ·
Maintainers usually reply within 2 days
-
HostDBContinuation::init memsets a polymorphic ActionPossibly taken @ANMOLSCRIPT claimed this today. OpenBug Good First Issue HostDB
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/trafficserver#14204 · 1 comment ·
Maintainers usually reply within 2 days
All issues in apache/trafficserver
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug compatibility difficulty:easy prio:normal
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NatronGitHub/openfx-misc#524 ·
Maintainers usually reply within 1 day
-
documentation enhancement help wanted P0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openscad/openscad#7360 · 2 comments ·
Maintainers usually reply within 1 day