Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport(v1.16) Windows: Fix an issue where stopping the service imme…
…diately after startup could leave the processes (#4782) (#4802) **Which issue(s) this PR fixes**: Backport #4782 **What this PR does / why we need it**: Add retry for stop event for Windows Service to fix #3937. If `Event.open()` ([OpenEvent](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-openeventw)) is called before the `Event.new()` ([CreateEvent](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventw)), `Event.open()` raises `Errno::ENOENT`. This causes the service to be stopped while the supervisor and worker process remains. It causes #3937. This PR fixes it by adding retry. https://github.com/fluent/fluentd/blob/30c3ce00ff165b1b5d9f53fc0a027074bbcab0da/lib/fluent/winsvc.rb#L90 https://github.com/fluent/fluentd/blob/30c3ce00ff165b1b5d9f53fc0a027074bbcab0da/lib/fluent/supervisor.rb#L299 **Docs Changes**: Not needed. **Release Note**: It would be good to have both of the following. * Windows: Fixed an issue where stopping the service immediately after startup could leave the processes. * Windows: Fixed an issue where stopping service sometimes can not be completed forever. Signed-off-by: Daijiro Fukuda <[email protected]> Signed-off-by: Kentaro Hayashi <[email protected]> Co-authored-by: Daijiro Fukuda <[email protected]>
- Loading branch information