Futex_wake_private with multiple instances, Octoprint_deploy

Howdy All

Recently I used octoprint_deploy to setup my Octoprint to run 2 printers from a single Raspberry Pi. For the most part I'm happy with the result, it actually does work.

However, I have been having a problem I don't understand and hope someone here can point me in the right direction. The problem I've been having is that my second instance goes off into the weeds and becomes non-functional. One of my instances runs on port 5000 the other on port 5001. If I curl I get a quick response, but if I curl I get a long delay before I get any response. When I perform an strace on the process I see:

clock_gettime64(CLOCK_MONOTONIC, {tv_sec=1579, tv_nsec=594007244}) = 0
futex(0x49be68, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x49be60, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=1579, tv_nsec=599007244},
FUTEX_BITSET_MATCH_ANY) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x49be48, FUTEX_WAKE_PRIVATE, 2147483647) = 1

Has anybody seen this? What resource is temporarily unavailable?


I think I discovered my issue. When my 2nd instance was unresponsive I noticed that octoprint analysis gcode process was running. I found a thread in the forum where a user was describing Octoprint being slow to respond while running gcode analysis and that it became responsive when it was disabled.

I've not disabled gcode analysis, but I did notice that when my instance became responsive again that it was no longer running.

I've looked in the documentation and it's not clear to me precisely what benefit gcode analysis provides, nor is it clear to me whether this is a one and done where once gcode has been analyzed it doesn't need to be done. I'm thinking that my problem stems from putting old gcode in a watched file system and between copying the watched files over to uploads and doing gcode analysis on them paralyzes my instance for a time. The futex was telling me a resource was unavailable but not which resource, I'm guessing that it may have been files that were locked due to being copied, for giggles I replaced the watched directory to an empty one and despite there being a period delay when the instance was starting, it became available more quickly and remained that way, prior to this it would come and go.

So, what exactly is the benefit of gcode analysis and can I expect that once a file is analyzed it won't need to be analyzed again?