-
Notifications
You must be signed in to change notification settings - Fork 2
Worker status pipeline for "alda parse" requests too #2
Comments
Should maybe rename the |
This is especially important for the new client/server implementation of the Alda REPL. Currently, long |
There's a bug that's a symptom of this as well. If you parse a sufficiently large file it will return 'no workers found' instead of properly returning the parsed data (since it timesout) |
Is this still of interest? I'd love to give it try |
@bernardo-amorim Absolutely, help would be much appreciated! Let us know (either here or in the #development channel in Slack) if you need any help figuring it out. |
I think the first step is to extract the "job" logic from alda-server-clj/src/alda/worker.clj Lines 121 to 146 in 34f5b4d
Then, alda-server-clj/src/alda/worker.clj Lines 85 to 110 in 34f5b4d
This could be as simple as taking an extra argument that is either |
OK, thanks for the response. I'll start coding it. |
I think this issue can be closed. I'm in the process of redesigning Alda for an eventual 2.0 release, and part of the new design is that most of the work will be done in the client, which will make this a non-issue. |
Since version 1.0.0-rc42, we've had a worker status pipeline for
alda play
requests only, in order to more robustly handle worker requests that take a long time from the client side.The idea is that when a worker receives a request, it starts handling it on a separate thread and goes into a particular working status like "parsing" or "playing," and it also immediately responds to the request to acknowledge that it received the request and is working on it. Then, the client can repeatedly make status requests to the worker so it can report when the worker is playing the score. The key thing here is that the client knows when to keep waiting vs. report that the request failed and exit.
We should extend this functionality to the
alda parse
command, too. Currently, the client just has a timeout interval, after which time it will retry the request again. If you do something likealda parse -c "(Thread/sleep 10000)" -m
, the client will get impatient and keep retrying the request until every available worker is busy parsing the same score! This effectively kills all of the available workers because they all stop what they're doing and evaluate this score that makes them pause for 10 seconds, causing the server to think the workers are dead and evict them from the worker queue. Yikes!The solution here is the same thing we implement for the
alda play
command, only the client would not print any of the status updates, since thealda parse
command is intended to print only the parsed output to STDOUT.The text was updated successfully, but these errors were encountered: