Don't busy-spin in tcp transport's event loop
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 368
- Avg merge
- 19h 32m
- Merged PRs (30d)
- 3
Description
Per @jjlilley in https://github.com/facebookincubator/gloo/pull/237#discussion_r356780531, we can use an eventfd(2) to avoid busy-spinning the epoll loop.
If we do, we must also update the code that unregisters an fd to either:
- Explicitly wake up the loop and wait for a tick
- Use refcounting on the handlers so we don't need to wait for a tick (loop keeps weak_ptr)
Contributor 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.
Research direction
Start by locating the TCP transport's epoll event loop and the code that unregisters file descriptors. Review how eventfd(2) can wake the loop, then determine whether unregistration should explicitly wake and wait for a tick or use handler refcounting; done means the loop no longer busy-spins while unregistering remains safe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100