-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
"Reload" and "systemctl restart" made different behavior for fluent-bit thread #8067
Comments
Reload is internal and presumably rolls back to previous config in memory @cosmo0920 ? |
Yes. Reload should be willing to be alive the old valid context as much as possible. Restarting should be halting Fluent Bit process when the malformed/invalid configuration is used. |
So the reload in fluent-bit was not designed for letting new configurations/reference files change take effect? As you can see, when i tried to deliberately make some syntax error in reference lua file, the fluent-bit can't work properly after reload, is this by design? |
Reload in fluent-bit is not designed for letting invalid/malformed configurations take effect. These should be halted and refused loading. But, it's not expected behavior when HTTP interface is not working with it after using malformed lua files. |
We should probably document it a bit though so if you can submit a docs PR @ym11369 that would be helpful. |
@patrick-stephens Once I thought this shouldn't be an issue. But, I diagnosed and wrote a patch to plug this case. |
I think this should be in 2.2.0 now @cosmo0920 / @ym11369 |
Yup. We plugged the case of making an invalid status of flb_ctx. So, could you try Fluent Bit 2.2 then? |
@ym11369 please verify and close if solved, otherwise this will be auto-closed fairly soon. |
Bug Report
Describe the bug
Found some issue during my test which try to make some indentation error in fluent-bit.conf or syntax error in reference lua file. The status of fluent-bit thread is different between 'reload' and 'systemctl restart'. Is this an expected behavior? Reload usually didn't kill the thread even have errors. Systemctl restart will fail to restart fluent-bit if any indentation error/syntax error.
Details:
Reload:
Reload post request returned
200 OK
and response was{"reload":"done","status":0}
. The output ofsystemctl status fluent-bit
looks no error's during this reload. fluent-bit thread alive. And it seems used old-cached fluent-bit.conf to run.And we can find the error in /var/log/syslog
Restart
But when we run
systemctl restart fluent-bit
the fluent-bit failed to be started. Fluentbit thread killed/var/log/syslog
Reload:
The output of
systemctl status fluent-bit
show errors[luajit] error loading script: //etc/fluent-bit/modify_user_record.lua:80: 'end' expected (to close 'for' at line 5) near '<eof>'
as expected. But fluent-bit thread looks alive. But the 2020 port was not work anymore.Consistent with /var/log/syslog
Restart
Same with 1, just different error msg, thread killed same with 1
To Reproduce
Expected behavior
Reload should have same behavior with systectl restart, killed thread and exit if have error
Your Environment
config.zip
The text was updated successfully, but these errors were encountered: