Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Register/Un-register Windows service causes warnings #246

Open
ksandrmatveyev opened this issue Apr 3, 2020 · 7 comments
Open

Register/Un-register Windows service causes warnings #246

ksandrmatveyev opened this issue Apr 3, 2020 · 7 comments

Comments

@ksandrmatveyev
Copy link

ksandrmatveyev commented Apr 3, 2020

Hi,
affected version: td-agent 3.7.0 for Windows
warning if you try to register/un-register Windows service:

PS C:\Temp\td-agent> fluentd --reg-winsvc i
[DEPRECATION] Struct layout is already defined for class Windows::ServiceStructs::SERVICE_STATUS_PROCESS. Redefinition as in C:/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/win32-service-0.8.10/lib/win32/windows/structs.rb:72:in `<class:SERVICE_STATUS_PROCESS>' will be disallowed in ffi-2.0.
PS C:\Temp\td-agent> $LASTEXITCODE
0
PS C:\Temp\td-agent> fluentd --reg-winsvc u
[DEPRECATION] Struct layout is already defined for class Windows::ServiceStructs::SERVICE_STATUS_PROCESS. Redefinition as in C:/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/win32-service-0.8.10/lib/win32/windows/structs.rb:72:in `<class:SERVICE_STATUS_PROCESS>' will be disallowed in ffi-2.0.

Tested OS: Windows Server 2016
td-agent version, that is going to be updated: 3.5.0

Is this something that should be handled?

@ksandrmatveyev
Copy link
Author

ksandrmatveyev commented Apr 4, 2020

Seems that the old version of win32-service gem is installed alongside with a new version:

PS C:\temp> fluent-gem list | findstr win32-service
win32-service (2.1.5, 0.8.10)
PS C:\temp> fluent-gem list -i win32-service -v 0.8.10
true

I guess this happens because of https://github.com/fluent/fluentd/blob/237b27625f99ad7c0d67d424180fb2afa73ba4fb/fluentd.gemspec#L35

@ksandrmatveyev
Copy link
Author

I'm not sure if this a reason of another issue that causes 5 ruby processes instead of 3 in basic scenario with Windows service + default 1 worker.

image

Steps to reproduce:

  1. install td-agent 3.5.0
  2. register Windows service and pass options to it
  3. unregister Windows service
  4. install td-agent 3.7.0
  5. register Windows service and pass options to it

Accepted behavior:
3 ruby processes
Current behavior:
5 ruby processes

@cosmo0920 , @repeatedly

@repeatedly
Copy link
Contributor

@cosmo0920 Did you see this problem before? I assume the problem is previous worker exists and supervisor creates new worker.

@cosmo0920
Copy link
Contributor

I'm investigating on it.

@cosmo0920
Copy link
Contributor

I'd checked this but I couldn't reproduce this issue...

@repeatedly
Copy link
Contributor

Thanks for the confirmation. So process shutdown failed unexpectedly and it causes this double loading. Hmm...

@skupjoe
Copy link

skupjoe commented Dec 3, 2020

Same issue for me. And this also seems to break the installer msi where it doesn't fully register/unregister the service during install or uninstall.

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

No branches or pull requests

4 participants