Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] enhance TaskRunner Process #2697

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Irving-cl
Copy link
Contributor

@Irving-cl Irving-cl commented Feb 6, 2025

This PR adds a check in TaskRunner::Process so that 'read' is only executed when the eventFd is set.

Currently if we use strace to see the i/o of otbr-agent, we can see many things like this:

read(7, 0x7ffc7c0f80ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
read(9, 0x7ffc7c0f80ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x7ffc7c0f80ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x7ffc7c0f80ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
read(9, 0x7ffc7c0f80ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x7ffc7c0f80ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)

Though this is harmless, we should avoid it as possible for easier debugging and reduce overhead.

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 43.29%. Comparing base (2b41187) to head (9d63ccd).
Report is 938 commits behind head on main.

Files with missing lines Patch % Lines
src/common/task_runner.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2697       +/-   ##
===========================================
- Coverage   55.77%   43.29%   -12.48%     
===========================================
  Files          87      108       +21     
  Lines        6890    13400     +6510     
  Branches        0      963      +963     
===========================================
+ Hits         3843     5802     +1959     
- Misses       3047     7291     +4244     
- Partials        0      307      +307     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Irving-cl Irving-cl force-pushed the fix_task_runner branch 2 times, most recently from 0105485 to c981d99 Compare February 7, 2025 01:54
Copy link
Contributor

@superwhd superwhd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Thanks for fixing this!

src/common/task_runner.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants