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

Add support for Workers #45

Open
kishaningithub opened this issue Jul 19, 2021 · 5 comments
Open

Add support for Workers #45

kishaningithub opened this issue Jul 19, 2021 · 5 comments

Comments

@kishaningithub
Copy link

Fluent bit added support for workers in v.1.7.0

https://fluentbit.io/announcements/v1.7.0/

It would be really valuble go plugins can also have worker support

Impact

Because of the single threaded nature if one output plugin is "stuck", then the subsequent outputs / pipelines are not getting executed fluent/fluent-bit#3088

I believe workers can solve this problem. Basically setting workers to 1 should ensure there is a separate thread for processing

@kishaningithub
Copy link
Author

From what i observed setting

Workers 1

did not spawn a new thread in the engine for data delivery.

IMO, full workers need not be supported as go lang has goroutines. But what is needed in an ability for the go plugins to run in a separate delivery thread.

gautampunhani added a commit to gautampunhani/fluent-bit that referenced this issue Jul 27, 2021
This patch adds worker support to golang output plugins, without which if golang plugins were becoming unresponsive it was blocking other i/p and o/p plugins as well
This fixes issue fluent/fluent-bit-go#45

Signed-off-by: Gautam Punhani <[email protected]>
gautampunhani added a commit to gautampunhani/fluent-bit that referenced this issue Aug 4, 2021
This patch adds worker support to golang output plugins, without which if golang plugins were becoming unresponsive it was blocking other i/p and o/p plugins as well
This fixes issue fluent/fluent-bit-go#45

Signed-off-by: Gautam Punhani <[email protected]>
gautampunhani added a commit to gautampunhani/fluent-bit that referenced this issue Aug 4, 2021
This patch adds worker support to golang output plugins, without which if golang plugins were becoming unresponsive it was blocking other i/p and o/p plugins as well
This fixes issue fluent/fluent-bit-go#45

Signed-off-by: Gautam Punhani <[email protected]>
nokute78 pushed a commit to fluent/fluent-bit that referenced this issue Aug 4, 2021
This patch adds worker support to golang output plugins, without which if golang plugins were becoming unresponsive it was blocking other i/p and o/p plugins as well
This fixes issue fluent/fluent-bit-go#45

Signed-off-by: Gautam Punhani <[email protected]>
@nokute78
Copy link
Contributor

nokute78 commented Aug 4, 2021

I merged the patch fluent/fluent-bit#3908
@gautampunhani Thank you.

@l2dy
Copy link
Contributor

l2dy commented Aug 4, 2021

Should we add the RWMutex mentioned in b191f58 to protect the contexts map?

@nokute78
Copy link
Contributor

nokute78 commented Aug 5, 2021

I think it is better to add RWMutex for prevention.

In my understanding, a lock is taken care on C side.
https://fluentbit.io/announcements/v1.7.0/

The multithread implementation is lock-free at runtime.

On the other hand, the API FLBPluginSetContext and FLBPluginGetContext are for golang side API.
We can't know when they are called.

@l2dy
Copy link
Contributor

l2dy commented Aug 5, 2021

I think "lock-free" means that there is no lock on the C side, so contexts in Go must be protected with a mutex or sync.Map.

edsiper pushed a commit to fluent/fluent-bit that referenced this issue Nov 18, 2021
This patch adds worker support to golang output plugins, without which if golang plugins were becoming unresponsive it was blocking other i/p and o/p plugins as well
This fixes issue fluent/fluent-bit-go#45

Signed-off-by: Gautam Punhani <[email protected]>
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

3 participants