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

fix segfault when thread is finalised without golang's runtime gc as … #9

Merged
merged 2 commits into from
May 12, 2022

Conversation

niedbalski
Copy link
Contributor

@niedbalski niedbalski commented May 12, 2022

Description

  • Enforces a runtime garbage collector when the context is done, to ensure that
    no object remains without a finaliser before the thread gets shutdown by fluent-bit.
  • Also, switching Message.Record type to any.

Fix

Without this fix, when cancelling the context and the channel has been written to:

[2022/05/12 09:42:13] [debug] [out flush] cb_destroy coro_id=0
[2022/05/12 09:42:13] [debug] [task] destroy task=0x4033ff63f0 (task_id=0)
^C[2022/05/12 09:42:14] [engine] caught signal (SIGINT)
[2022/05/12 09:42:14] [ warn] [engine] service will shutdown in max 5 seconds
[2022/05/12 09:42:14] [ info] [engine] service has stopped (0 pending tasks)
[2022/05/12 09:42:14] [debug] [GO] running exit callback
2022/05/12 09:42:14 calling FLBPluginExit(): name="go-s3-replay-plugin"
[2022/05/12 09:42:14] [engine] caught signal (SIGSEGV)
qemu: uncaught target signal 6 (Aborted) - core dumped

with this fix, same operation, no segfault.

[2022/05/12 09:43:43] [ warn] [engine] service will shutdown in max 5 seconds
[2022/05/12 09:43:43] [ info] [engine] service has stopped (0 pending tasks)
[2022/05/12 09:43:43] [debug] [GO] running exit callback
2022/05/12 09:43:43 calling FLBPluginExit(): name="go-s3-replay-plugin"
[2022/05/12 09:43:43] [ info] [output:stdout:test-output] thread worker #0 stopping...
[2022/05/12 09:43:43] [ info] [output:stdout:test-output] thread worker #0 stopped

Signed-off-by: Jorge Niedbalski [email protected]

@niedbalski niedbalski marked this pull request as ready for review May 12, 2022 09:40
@niedbalski niedbalski requested a review from nicolasparada May 12, 2022 09:40
Copy link
Contributor

@nicolasparada nicolasparada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@niedbalski niedbalski merged commit 7d0d583 into main May 12, 2022
@niedbalski niedbalski deleted the fix-segfault branch July 22, 2022 09:31
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

Successfully merging this pull request may close these issues.

2 participants