Stop Actions using Action Id
Sometimes, you or your team may start a job that runs for several hours and becomes unresponsive, or is otherwise unable to complete. Unnecessary actions may cause a cluster to become slow or unresponsive. C3 provides a way to target these actions and stop them immediately, based on the action id.
This topic demonstrates step by step instructions on how to terminate an action on a Single Node Environment (SNE) or a Shared Environment.
Interrupt an action on a Single Node Environment
If you are working on an SNE, you can find the action and interrupt it directly.
Open the static console for your environment. Open Chrome Developer Tools to access console commands.
Use the following code snippet to identify all actions on your node.
JavaScriptApp().actions()You may have to expand details for your action to find the specific action to terminate.
Find the
idfor the action, and use it to specify the action to stop.JavaScriptJs.exec(`Action.forId("ID.NUMBER").interrupt()`)
Interrupt an action on a Shared Environment
Shared Environments have a leader node and task nodes.
Interrupting an action on the leader node is the same as interrupting actions on an SNE. See the previous section for more details.
Interrupting an action on a task node needs a different console command from the previous section. More specifically, you need to specify which node for the specific action.
JavaScriptC3.app().nodes()[1].callJson("Action", "interrupt", C3.app().nodes()[1].callJson("Action", "forId", null, ["ID.NUMBER"]), ["Taking too long to complete"])
Example of interrupting an action on an SNE
This example creates an action using Echo, finds the action, and interrupts it.
Open you application console and open Chrome Developer Tools.
Run
Echo.echoStrWithSleep("hi", 1000)to start an action that lasts for 1000 seconds.You may need to refresh the page for this step, since the
Echoaction is running. RunApp.actions()to find the in progress action. You may need to expand the details of some elements in the array to see theidfield to get the ID number.Use
Js.exec(`Action.forId("ID.NUMBER").interrupt()`). ReplaceID.NUMBERwith the ID number.