DiagsLogContinuation and MemoryLimit are scheduled on ET_TASK before ET_TASK is registered

Open Beginner friendly
#14,201 0 comments 0 reactions 0 assignees View on GitHub

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

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

Bug Core Event System Logging Startup

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:

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/trafficserver

All issues in apache/trafficserver

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.