You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, we can run fluentd as a Windows Service.
(Windows PowerShell with Administrative privilege)
# Register
> fluentd.bat --reg-winsvc i
> fluentd.bat --reg-winsvc-fluentdopt '-c C:/test/td-agent.conf -o C:/test/td-agent.log'
# Start the service
> Start-Service fluentdwinsvc
# Stop the service
> Stop-Service fluentdwinsvc
# Unregister
> fluentd.bat --reg-winsvc u
With certain conditions, Stop-Service can not be completed forever.
This happens when multiple supervisor processes are running simultaneously for some reason (perhaps accidentally).
We can stop the service while leaving the supervisor and worker alive as following.
# First, make sure the service is stopped.
> Stop-Service fluentdwinsvc
# Then, start the service and immediately stop it.
> Start-Service fluentdwinsvc
> Stop-Service fluentdwinsvc
# We can see 2 ruby processes still alive. (supervisor and worker process)
> ps -ProcessName rubyHandles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName------- ------ ----- ----- ------ -- -- ----------- ... ... ... ruby ... ... ... ruby
Start the service again, and now we can see 5 processes.
This is the situation where multiple supervisor processes are running simultaneously.
Then we can reproduce this issue by stopping the service again.
Sorry for the Japanese language environment.
> Stop-Service fluentdwinsvc警告: サービス 'Fluentd Windows Service (fluentdwinsvc)' の停止を待っています...警告: サービス 'Fluentd Windows Service (fluentdwinsvc)' の停止を待っています...警告: サービス 'Fluentd Windows Service (fluentdwinsvc)' の停止を待っています...(repeats forever)
The messages may be as follows in English
> Stop-ServiceWARNING: Waiting for service 'Fluentd Windows Service (fluentdwinsvc)' to stop...WARNING: Waiting for service 'Fluentd Windows Service (fluentdwinsvc)' to stop...WARNING: Waiting for service 'Fluentd Windows Service (fluentdwinsvc)' to stop...(repeats forever)
Expected behavior
The supervisor process of the service stops for sure.
Or, if fluentd doesn't expect multiple supervisors to run simultaneously, all supervisor processes should stop when stopping the service.
Your Environment
- Fluentd version: 1.15.2
- Operating system: Windows 10
Your Configuration
The config has nothing to do with this issue.
<source>
@type dummy
tag test.log
rate 1
dummy {"message": "This is the test message"}
</source>
<match test.**>
@type stdout
</match>
Your Error Log
Sorry for the Japanese language environment
> Stop-Service警告: サービス 'Fluentd Windows Service (fluentdwinsvc)' の停止を待っています...警告: サービス 'Fluentd Windows Service (fluentdwinsvc)' の停止を待っています...警告: サービス 'Fluentd Windows Service (fluentdwinsvc)' の停止を待っています...(repeats forever)
The messages may be as follows in English
> Stop-ServiceWARNING: Waiting for service 'Fluentd Windows Service (fluentdwinsvc)' to stop...WARNING: Waiting for service 'Fluentd Windows Service (fluentdwinsvc)' to stop...WARNING: Waiting for service 'Fluentd Windows Service (fluentdwinsvc)' to stop...(repeats forever)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
On Windows, we can run fluentd as a Windows Service.
(Windows PowerShell with Administrative privilege)
With certain conditions,
Stop-Service
can not be completed forever.This happens when multiple supervisor processes are running simultaneously for some reason (perhaps accidentally).
Fluentd uses Event Objects for signals on Windows.
This event's type is
Auto-reset event
, so the event is automatically unsignalled when one process receives it.Win32::Event.new
: https://github.com/chef/win32-event/blob/main/lib/win32/event.rb#L63If another supervisor unintentionally receives the event, the process that should be stopped fails to receive it and continues to run.
This makes the service wait for the stopping process forever.
If we kill all fluentd processes (the service process, supervisor, and workers), we can stop the service forcibly.
To Reproduce
Sorry for the Japanese language environment.
The messages may be as follows in English
Expected behavior
The supervisor process of the service stops for sure.
Or, if fluentd doesn't expect multiple supervisors to run simultaneously, all supervisor processes should stop when stopping the service.
Your Environment
Your Configuration
The config has nothing to do with this issue.
Your Error Log
Sorry for the Japanese language environment
The messages may be as follows in English
Additional context
No response
The text was updated successfully, but these errors were encountered: