hmm… i wonder how reliable <https://stackoverflow....
# development
w
h
what’s the use case? I had major issues trying to get this to work on a personal project two years ago. I ended up splitting my script up into two parts and having the user rerun the script after part 1 finished
I don’t remember the issue; just that it was hard and I realized not worth it
w
reloading rules without restarting pantsd
sortof a holy grail usecase, so would be great if there was a reliable way to do it.
h
My first instinct would be that this is not thread safe. Not sure if that’s true, but worth verifying
w
although i would not be surprised if there is not a reliable way, heh
@hundreds-father-404: oh yea, i’m sure it’s not. but we’d acquire a lock on the scheduler to reload.
👍 1
even then, i think it still amounts to completely recreating the scheduler, but it means we don’t need to restart the server to pick up changes to the pythonpath.
But I think this relates to an idea @enough-analyst-54434 had had about "socket activation". On file change, we could cold reload in place in pantsd by re-exec'ing with our existing server socket. Wouldn't hold onto any state, but maybe that's for the best.
Works for the "our pythonpath has changed" case, because we'd wait to do it until there were no active clients.
…but. reading more closely, most of the caveats are around static state, which we do not have for plugins. i think that we could probably actually do plugin auto-reload.