<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2024 at 12:16 AM <<a href="mailto:alexey@pavlyuts.ru">alexey@pavlyuts.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ken, <br>
<br>
thank you great for your prompt help!<br>
<br>
> The second one: --sync-call only waits for the change to be committed to the CIB,<br>
> not for the cluster to respond. For that, call crm_resource --wait afterward.<br>
<br>
It seems like crm_resource --wait is a very reliable and proven, but veeeeery slow approach. I found that even on sustained cluster it takes around 2-2.4 seconds for this command returns. When I add it to my script flow after resource disable and before deletion, it takes the same time about 2-2.2 sec:<br>
<br>
2024-08-12 21:58:14,105 - DEBUG Start applying resource stop changes<br>
2024-08-12 21:58:14,126 - DEBUG Start crm_resource --wailt<br>
2024-08-12 21:58:16,152 - DEBUG Start applying final changes<br>
2024-08-12 21:58:16,173 - INFO     Send request answer<br>
<br>
Here it waits 2.26s. The same as sustained call, so I suppose the delay is not too much related to cluster state. <br>
<br>
But I know that real stop happens within about 100-200 ms unless some special conditions happen. The problem is my code works as API server to external system, and it is only one small part of job so 2s of waiting is not a good for me (((<br>
<br>
Is there any way to get a list of unfinished start/stop tasks? Sure, I can build the list of resource to be stopped and just check with crm_mon about its status unless everyone stopped or error, I can catch resource events and watch for every planned stop finished, but it looks simpler and more reliable to get active stop task list, if available.<br></blockquote><div><br></div><div>Don't know if there is a way to acquire such a list in an (easy) way using public api.</div><div>Basically you might consider making your API asynchronous in that aspect.</div><div>Did you explore what alerts might give you? You might get notification about successful</div><div>stops / respectably failed stops more quickly and collect them to be used either by</div><div>the synchronous API or an asynchronous version.</div><div><br></div><div>Klaus </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thank you once again!<br>
<br>
Sincerely,<br>
<br>
Aalex<br>
<br>
_______________________________________________<br>
Manage your subscription:<br>
<a href="https://lists.clusterlabs.org/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.clusterlabs.org/mailman/listinfo/users</a><br>
<br>
ClusterLabs home: <a href="https://www.clusterlabs.org/" rel="noreferrer" target="_blank">https://www.clusterlabs.org/</a><br>
<br>
</blockquote></div></div>