cloudflare / tableflip

Graceful process restarts in Go
BSD 3-Clause "New" or "Revised" License
2.91k stars 148 forks source link

[Question] Windows #21

Closed Belphemur closed 5 years ago

Belphemur commented 5 years ago

Hello,

Do you know if the lib would work on Windows ? with GOOS=windows ?

lmb commented 5 years ago

Hi!

I've not tested it, but I'm pretty sure it won't work unfortunately. The library relies on the fact that file descriptors follow a predicable pattern on Unix-ish systems. AFAIK Windows uses opaque HANDLEs instead, which means some other method would have to be found.

Do you have a service that needs to work on Unix and Windows, or just Windows?

Belphemur commented 5 years ago

Hello Lorenz,

Thank you for the the quick answer. Thats also what I gathered when I dig into the code, just wanted to be sure.

It's for a service that currently runs on both OSes, dnscrypt-proxy. I loved the idea of a simple signal to have a new process been run instead of implementing a whole reload logic.

On another note would the lib support sustemd socket?

Do you think that would be easy or interesting to add?


From: Lorenz Bauer notifications@github.com Sent: Friday, February 8, 2019 05:23 To: cloudflare/tableflip Cc: Antoine Aflalo; Author Subject: Re: [cloudflare/tableflip] [Question] Windows (#21)

Hi!

I've not tested it, but I'm pretty sure it won't work unfortunately. The library relies on the fact that file descriptors follow a predicable pattern on Unix-ish systems. AFAIK Windows uses opaque HANDLEs instead, which means some other method would have to be found.

Do you have a service that needs to work on Unix and Windows, or just Windows?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

lmb commented 5 years ago

Are you referring to socket activation? I sketched out a solution in https://github.com/cloudflare/tableflip/issues/14#issuecomment-451939430 which might be what you are looking for. Depending on how complex the code ends up being it could become an example, or a sub package.

If socket activation is what you want I'd suggest re-opening that issue.

Belphemur commented 5 years ago

Good point.

I'm closing this issue since the answer is "Not working with Windows".

Maybe you could add that somewhere in the readme or have a check for GOOS in the code to fail on compile :)