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

Hot reload fails when running as a Windows service #9824

Open
williamb1024 opened this issue Jan 12, 2025 · 2 comments
Open

Hot reload fails when running as a Windows service #9824

williamb1024 opened this issue Jan 12, 2025 · 2 comments

Comments

@williamb1024
Copy link

Bug Report

Describe the bug
When running fluent-bit as a Windows service, calls to http://localhost:2020/api/v2/reload fail with an HTTP status of 500.

To Reproduce

  • Configure fluent-bit as a Windows service
  • Enable HTTP server and hot reload support
  • Request a reload through HTTP

Expected behavior
Fluent-bit would respond with an HTTP status 200 OK and reload its configuration.

Your Environment

  • Version used: 3.2.4

  • Configuration:

    service:
      http_server: true
      http_listen: 0.0.0.0
      http_port: 2020
      hot_reload: true 
    
  • Operating System and version: Windows 11 24H2

  • Filters and plugins: None

Additional context
This issue prevents reloading due to configuration changes. A simple workaround is the restart the fluent-bit service.

The issue appears to be:

ret = GenerateConsoleCtrlEvent(1 /* CTRL_BREAK_EVENT_1 */, 0);

GenerateConsoleCtrlEvent fails in the context of a Windows service. I believe, but have not tested, that the process is started in a detached console mode, which prevents GenerateConsoleCtrlEvent from succeeding.

A simple solution would be to use AllocConsole() when run as a Windows service.

@patrick-stephens
Copy link
Contributor

I think this is a known issue @pwhelan already has a fix for we just need to upstream it.

@pwhelan
Copy link
Contributor

pwhelan commented Jan 13, 2025

I think this is a known issue @pwhelan already has a fix for we just need to upstream it.

I fixed the problem specifically for fleet but can I apply the same fix for the hotreload HTTP API. Will submit a PR once I test on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants