rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
12.33k stars 3.92k forks source link

Replace `handle.exe` with `fshc.exe` #12369

Open lukebakken opened 2 months ago

lukebakken commented 2 months ago

handle.exe does not reliably produce parsable output. On top of that, it is closed source abandonware.

We should replace it with a small open source alternative our team members have developed as a personal project.

Some things involved

Migration Strategies

fhsc can continue being an optional dependency that, unlike handle.exe is open source and can produce easier to parse output (JSON).

  1. handle.exe will then be deprecated
  2. Both will be supported for a period of time
  3. fshc will eventually become the only option

Or, for 4.1.0 or 4.2.0, we can stop supporting handle.exe since it is optional already, and move straight to using fshc's JSON output.

Right now the biggest item left is a an Actions workflow that would produce 64-bit builds of fshc for Windows, Linux and macOS (the latter two for anyone who may need it, not for RabbitMQ's own needs).

References

michaelklishin commented 2 months ago

fhsc can continue being an optional dependency that, unlike handle.exe is open source and can produce easier to parse output (JSON).

  1. handle.exe will then be deprecated
  2. Both will be supported for a period of time
  3. fshc will eventually become the only option

Or, for 4.1.0, we can stop supporting handle.exe since it is optional already, and move straight to using fshc's JSON output.

Right now the biggest item left is a an Actions workflow that would produce 64-bit builds of fshc for Windows, Linux and macOS (the latter two for anyone who may need it, not for RabbitMQ's own needs).

Digiover commented 2 months ago

For what it's worth, handle.exe (or Windows in general) requires administrator privileges to list file and socket handles and information, as described in the "Installation" section of the documentation.

Notice the difference: Screenshot 2024-09-27 084924

Screenshot 2024-09-27 084946

In both sessions I started C:\Windows\System32\handle64.exe -nobanner | more.

I'm unsure why the notice is logged when RabbitMq runs as Local System and starts / spawns handle.exe. Maybe someone can catch that using ProcMon :)

michaelklishin commented 1 week ago

IMO as of 1.2.0, fshc is ready to be integrated.