Repository navigation
Saltnado runner client results in blocking call despite being set-up as Runner.async - #25427
tony-cocco wants to merge 1 commit into
Conversation
The runner client is set up to run jobs asynchronously but currently yields till it returns, defeating the purpose of running it as async. Updated the `_disbatch_runner` to better mirror it's async functionality.
|
@jacksontj Would you mind having a look at this? |
|
So this request is a bit confusing, but I think I understand the ask-- so let me recap. The calls to saltnado with a runner client are non-blocking on the master, but the HTTP request stays open until the response is there (hence your statement "the saltnado call blocks until it returns"). To be clear though-- it is still non-blocking, it just returns more than you want. From a quick look through the code that is how its documented (runner client returns the full return). This functionality is the same in both the tornado and cherrypy version of the api-- so we can't really change it (let alone the clients!). That being said we can probably add something like |
|
PR opened with new |
|
👍 for |
|
@whiteinge Mind opening a separate issue for those other endpoints? They might take a while, but we can crank them out over time ;) For all of the other ones in saltnado I've had to use localclients etc. directly-- as the API endpoints in netapi were blocking in some way or another. I'll probably want to revisit that now though as tornado is in the core so it would be reasonable to add/change APIs to do some of that stuff ;) |
|
I agree with your recap @jacksontj. However, the difference is a 30s+ REST call and a <1s call. +1 to Thanks! |
|
Yea, the intent of saltnado is to make it non-blocking into Salt, not On Wed, Jul 15, 2015 at 9:10 AM, Anthony Cocco [email protected]
|
|
@jacksontj filed. Definitely make changes as you see fit to RunnerClient and WheelClient to make them truly async on the backend now that Tornado is a core dep. I'd like to dive in to Saltnado and help with the transition but Salt has my time pretty well tapped for the foreseeable coming months. As you mentioned though, we'll get 'em over time. That interface is stable and doesn't see much churn at all. :-) |
|
I mentioned this in the above-linked issue but to second it here: The non-async API clients should present a blocking HTTP response regardless of what happens on the backend. The async clients should return an instant response with a JID. @tony-cocco thanks a ton for diving in here and submitting code! To be consistent with |
|
@whiteinge Completely agree! |
Despite being set up as an asynchronous client, the saltnado call blocks until it returns. The expected behavior is immediately returning object containing a
jid, the same response as usingclient=local_async.Steps:
POSTa command to/usingclient=runner, examplePOSTbody:fun=state.orchestrate&client=runner&mods=orchestrate.my_orchestrate&pillar={}Salt master running on Linux CentOS6. Relevant output of
salt --versions-report:A more desirable fix may be to add a new client,
runner_async, and convert the current runner to a synchronous model, inline withclient=local. For my use case, this fix is perfectly fine as we want everything running async.