-
Notifications
You must be signed in to change notification settings - Fork 1.7k
out_pgsql: add a configurable value called "daemon" for out pgsql plugin #7215
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
base: master
Are you sure you want to change the base?
out_pgsql: add a configurable value called "daemon" for out pgsql plugin #7215
Conversation
example config file for running out_pgsql in daemon mode:
running result and valgrind result:example config file for running out_pgsql not in daemon mode:
running result and valgrind result: |
related document Merge Request |
b4c4d34
to
f3d62a4
Compare
@sxd pls take a look |
@edsiper will take a look later today @TomlinfreeGit the DCO test it's failing, can you please fix that in the meantime? Best Regards! |
@@ -143,6 +143,10 @@ int pgsql_next_connection(struct flb_pgsql_config *ctx) | |||
struct mk_list *head; | |||
int ret_conn = 1; | |||
|
|||
if (ctx ==NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another space it's missing here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in the commit: out_pgsql: code-format &if config err then log err
@TomlinfreeGit so, the idea it's the just restart or make the error not a crash here right? what if the user don't see this error ? how they will suppose to know that there's an error in the configuration ? |
Signed-off-by: Tom <yao.lin@siemens.com>
Signed-off-by: Tom <yao.lin@siemens.com>
f3d62a4
to
53ce527
Compare
Signed-off-by: Tom <yao.lin@siemens.com>
Yes, for other out_plugins, error configuration will not cause fluent-bit crash, just log error when failed to flush data, and can be noticed by health_check; However for out_pgsql, error configuration will cause fluent-bit crash directly. |
@TomlinfreeGit Testing this after a couple of minutes, about 10 minutes, I don't see any error in the logs saying that something needs to be fixed, the plugin just finished, doesn't look like a desire behavior since everything will work and will start, but if I can't flush the logs to the desired database this may be an issue. This it's what I can see in the logs:
And that's it, now on the API I'm getting this:
So, how someone will notice that there's an error if everything start without problem? in my opinion a daemon should fail if there's anything that may cause an error, just like inside a pod/container, it will be restarted until something it's fixed, this it's more like making an error kind of invisible. On the other hand, which plugins in Fluent-Bit behaves like what you want to add? Thanks in advance! |
Hi, I can give some some examples to explain how other out_plugins behave when user give wrong configuration. example 1(a.config):
running config file a.config for several minutes, fluent-bit will not crash, then you will get the following logs: example 2(b.config):
running config file b.config, fluent-bit will exit directly, even if user give correct configuration for the other out_plugins(stdout) and you will get following logs: example 3(c.config) out_pgsql running with daemon mode:
running config file c.config for several minutes, fluent-bit will not crash, then you will get the following logs: |
Thanks for your kind review.
and call http://127.0.0.1:2020/api/v1/health to notice the health status of fluent-bit |
@TomlinfreeGit Hi! I was on holidays for the last month so I didn't look into this, I'm getting into this today |
please do help for a review
|
@sxd Hi please help do a review, if possible, thanks very much! |
update out_pgsql plugin: add a configurable parameter to support run this plugin in a daemon mode.
if in daemon mode, configuration error of out_pgsql will not cause fluentbit crash or exit.
N/A
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.