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

Should mk_event_wait handles EINTR? #356

Open
lobshunter opened this issue Dec 5, 2021 · 0 comments
Open

Should mk_event_wait handles EINTR? #356

lobshunter opened this issue Dec 5, 2021 · 0 comments

Comments

@lobshunter
Copy link

lobshunter commented Dec 5, 2021

Bug Report

What did you do?
I ran fluent-bit kubernetes daemonset with HTTP server on, it starts a monkey server inside.

What did you see?
HTTP server of fluent-bit exits several seconds after fluent-bit started, but fluent's log scraping still works.
However, it leads to kubernetes liveness probe failure, hence fluent-bit will be SIGTERM killed again and again.

What do you know about this?
After a lot of digging I found that epoll_wait here does not handles negative return value, so mk_event_wait here returns unexpectedly, then HTTP server exits too.

In my case, the epoll_wait returns -1 and errno is EINTR. According to epoll_wait(2)

The call was interrupted by a signal handler before either
(1) any of the requested events occurred or (2) the timeout expired.

I found a solution in stackoverflow which ignores the EINTR error. That works for me.

So I wonder if this is a bug of monkey? And maybe other mk_event_wait implementations like select should handle such return value too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant