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

reload: fix hotreload when running on windows as service. #9908

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pwhelan
Copy link
Contributor

@pwhelan pwhelan commented Feb 3, 2025

Summary

This PR involves several changes which allow both the API and fleet to reload on windows when running fluent-bit as a service.

Description


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:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

@pwhelan pwhelan marked this pull request as draft February 3, 2025 16:19
@pwhelan
Copy link
Contributor Author

pwhelan commented Feb 3, 2025

This should resolve #9824.

@@ -266,6 +267,8 @@ struct flb_config {
int enable_hot_reload;
int ensure_thread_safety_on_hot_reloading;
unsigned int hot_reloaded_count;
unsigned int hot_reloaded_failures_count;
volatile sig_atomic_t bin_restarting;
Copy link
Member

Choose a reason for hiding this comment

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

why this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally this code was used to improve the reliability of the reload API so that it could be used in testing:

  • bin_restarting was refactored out of the src/fluent-bit.c file to expose it to the reload API to better track the reload state
  • hot_reloaded_failures_count was added to track failed reloads.

The hot_reloaded_failures_count is not crucial to this patch and can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@edsiper should I drop hot_reloaded_failures_count and the relevant code?

@pwhelan pwhelan requested a review from edsiper February 4, 2025 19:11
@pwhelan pwhelan marked this pull request as ready for review February 4, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants