sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

fix: prevent getting jobs when generation running #90

Closed MaikoTan closed 1 year ago

MaikoTan commented 1 year ago

Description

fix #89

Type of changes

Please check the following items before submitting your pull request

Maeyanie commented 1 year ago

I tested this and it appears to deadlock the instance when a poll happens. I'm guessing that's not a reentrant lock?

Testing on Win10, Python 3.10.8 from conda-forge.

Edit: Yeah, looking at the code, that lock is also acquired inside handle_request, which is inside that. Removing all 4 locks from handle_request (Which looks like they're unnecessary now that it's locked before calling that function? I don't know your code so not sure if it's called anywhere else.) seems to have fixed it.