romange / helio

A modern framework for backend development based on io_uring Linux interface
Apache License 2.0
435 stars 49 forks source link

chore: general improvements to fibers #193

Closed romange closed 9 months ago

romange commented 9 months ago

The main change is that we now rely on liburing function io_uring_peek_batch_cqe to peek for completions instead of manually iterating with io_uring_for_each_cqe call. The reason for this is that iouring API evolved, and the logic for peeking completions became non-trivial: it requires calling a system call in some rare cases. So in terms correctness and ease of maintainance it's better to rely on the library function to do the right job. In addition, fibers scheduler code has non-functional changes:

a. Added a trace variable to ease with debugging: it shows the last transitioned state of the fiber in ambigous situations. b. ProcessSleep now returns the number of woken fibers.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (bde6d74) 79.24% compared to head (f5a6511) 79.16%.

Files Patch % Lines
util/fibers/uring_proactor.cc 77.55% 11 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #193 +/- ## ========================================== - Coverage 79.24% 79.16% -0.08% ========================================== Files 100 100 Lines 7496 7507 +11 ========================================== + Hits 5940 5943 +3 - Misses 1556 1564 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

chakaz commented 9 months ago

Hey Roman, shall I take a look despite the failing test? Wanna let me know when to look?

romange commented 9 months ago

@chakaz you can look now :)