MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / wait_for_probe

Function wait_for_probe

pengine/allocate.c:775–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773}
774
775static void
776wait_for_probe(resource_t * rsc, const char *action, action_t * probe_complete,
777 pe_working_set_t * data_set)
778{
779 if (probe_complete == NULL) {
780 return;
781 }
782
783 if (rsc->children) {
784 GListPtr gIter = rsc->children;
785
786 for (; gIter != NULL; gIter = gIter->next) {
787 resource_t *child = (resource_t *) gIter->data;
788
789 wait_for_probe(child, action, probe_complete, data_set);
790 }
791
792 } else {
793 char *key = NULL;
794
795 if(safe_str_eq(action, RSC_STOP) && g_list_length(rsc->running_on) == 1) {
796 node_t *node = (node_t *) rsc->running_on->data;
797
798 /* Stop actions on nodes that are shutting down do not need to wait for probes to complete
799 * Doing so prevents node shutdown in the presence of nodes that are coming up
800 * The purpose of waiting is to not stop resources until we know for sure the
801 * intended destination is able to take them
802 */
803 if(node && node->details->shutdown) {
804 crm_debug("Skipping %s before %s_%s_0 due to %s shutdown",
805 probe_complete->uuid, rsc->id, action, node->details->uname);
806 return;
807 }
808 }
809
810 key = generate_op_key(rsc->id, action, 0);
811 custom_action_order(NULL, NULL, probe_complete, rsc, key, NULL,
812 pe_order_optional, data_set);
813 }
814}
815
816/*
817 * Check nodes for resources started outside of the LRM

Callers 1

probe_resourcesFunction · 0.85

Calls 2

generate_op_keyFunction · 0.85
custom_action_orderFunction · 0.85

Tested by

no test coverage detected