Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Fix: workflow run failure due to use of invalid signal(SIGQUIT) on Windows Machines#316

Closed
jishnundth wants to merge 1 commit intohatchet-dev:mainfrom
jishnundth:fix/windows-sigquit
Closed

Fix: workflow run failure due to use of invalid signal(SIGQUIT) on Windows Machines#316
jishnundth wants to merge 1 commit intohatchet-dev:mainfrom
jishnundth:fix/windows-sigquit

Conversation

@jishnundth
Copy link

signal.SIGQUIT is not available in Windows machines, causing Worker setup failures.
As a fix, replaced signal.SIGQUIT with signal.SIGBREAK if the user machine is windows.

closes #308

Reference: https://docs.python.org/3/library/signal.html#signal.signal

@mrkaye97 mrkaye97 self-requested a review February 10, 2025 18:24
@grutt
Copy link
Contributor

grutt commented Feb 11, 2025

Thanks for this contribution @Jishnu-Nandhiath. I'm open to improving windows developer experience but we're not planning on adding test coverage to windows at this time. Perhaps we should print a warning on start (or at the very least add a warning to the readme here)?

@mrkaye97, open to your thoughts here as well.

@jishnundth
Copy link
Author

Hey, If that's the case, we can just mention that Windows is not supported at the moment on the readme, like you mentioned. And show a warning at first during run, and the code will fail as usual.

@mrkaye97
Copy link
Contributor

hey @Jishnu-Nandhiath - agreed with @grutt here! If this works I'd be happy to ship it, but I have some concerns about the rest of the SDK running correctly on Windows because of how much we rely on multiprocessing internally. Did you install this version of the package and try running a worker + some tasks by any chance?

@jishnundth
Copy link
Author

@mrkaye97 I've tested it with the python quick-start tutorial only. And after the fix, the workflow was successfully registered in the dashboard, and was able to play with it from there.

One error that was showing here was

  File "hatchet-python\hatchet_sdk\worker\action_listener_process.py", line 75, in __post_init__
    loop.add_signal_handler(signal.SIGINT, noop_handler)
  File "\Programs\Python\Python311\Lib\asyncio\events.py", line 574, in add_signal_handler
    raise NotImplementedError
NotImplementedError

Which seems to be fine, because noop_handler was not implemented in the SDK code

def noop_handler():
    pass

@mrkaye97
Copy link
Contributor

hey @Jishnu-Nandhiath, thanks for looking into this and for putting in this change 😄

ultimately, even with this change, I think there are too many possible problems here for it to be worth trying to really support Windows on our end, and I don't think it's worth the rabbit hole.

do you think that using WSL would be an option for you? I'm going to close this PR, but happy to discuss more on that front. Thanks again!

@mrkaye97 mrkaye97 closed this Feb 11, 2025
@jishnundth
Copy link
Author

jishnundth commented Feb 11, 2025

@mrkaye97 Yeah, I think you guys are right. There's too much fix required here and there to make it work. The asyncio, loop event handlers written currently are also Unix specific. That's why NotImplementedError was coming.

https://docs.python.org/3/library/asyncio-eventloop.html#unix-signals

@JV-X
Copy link

JV-X commented Feb 13, 2025

When will full Windows support be added?

@mrkaye97
Copy link
Contributor

Hey @JV-X - we don't have Windows support on our roadmap right now. I'd recommend trying out running Hatchet workers using WSL if you need to develop locally!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support windows

4 participants