The ClusterResourceControl function and the ClusterResourceTypeControl function are serialized by the resource monitor (838869)



The information in this article applies to:

  • Microsoft Cluster Server

SUMMARY

This article describes a situation where the resource monitor may stop responding in Microsoft Cluster Server. The problem is caused by a custom Resource Type DLL and occurs because the ClusterResourceControl function and the ClusterResourceTypeControl function are serialized by the resource monitor.

SYMPTOMS

If two resources are hosted in the same resource monitor, and if you try to pass Resource control codes or Resource Type control codes from one resource DLL to itself or to another resource, the resource monitor may stop responding.

Additionally, the cluster service may seem to stop responding because the cluster service cannot receive any Resource control codes or Resource Type control responses from the resource monitor.

CAUSE

This problem occurs because all calls to the ClusterResourceControl function and to the ClusterResourceTypeControl function are serialized across all resources in the same resource monitor.

The following example assumes two different resources, resourceA and resourceB. If resourceA passes a control code to itself or to resourceB from its own ClusterResourceControl function or ClusterResourceTypeControl function, the call cannot be completed. The call does not complete because the resource monitor is waiting for the ClusterResourceControl function or the ClusterResourceTypeControl function of resourceA to be completed. This behavior causes the symptoms that are described earlier.

WORKAROUND

To work around this problem, force the resources to be in separate resource monitors.

To do this, use one of the following methods:
  • In Cluster Administrator, right-click the resource, click the General tab, and then select the Run this resource in a separate Resource Monitor check box.
  • Use the Cluster.exe tool. To do this, run the following command at a command prompt:

    cluster res <res name> /prop SeparateMonitor=1

  • You can do this programmatically by using one of the following:
    • Server Cluster APIs
    • Cluster Automation Server
    • WMI Cluster Provider that is available in Microsoft Windows Server 2003

MORE INFORMATION

Sample code

The following sample code reproduces the problem that is described in this article.
hCluster = OpenCluster(NULL);
                
switch (nControlCodeIn) 
{
     case CLUSCTL_RESOURCE_<some control code>:
     {
          hRes = OpenClusterResource( hCluster, resourceEntry->ResourceName );               
          hDepRes = ResUtilGetResourceDependency( hRes, lpszResourceType);
                
          status = ClusterResourceControl( hDepRes,             // Handle to resource
                                   NULL,                     	// Host node
                                   nControlCodeIn,              // Control code    
                                   NULL,                        // InBuffer
                                   0,                           // Size of InBuffer
                                   resourceEntry->buf,          // OutBuffer
                                   resourceEntry->size,         // Size of OutBuffer
                                   &BytesReturned               // Actual bytes returned
                                   );                 
                
          resourceEntry->size = BytesReturned;
          break;
     }

     case CLUSCTL_RESOURCE_TYPE_<some control code>:
     {
          status = ClusterResourceTypeControl( hCluster,          // Handle to cluster
                                   lpszResourceType,              // Dependent resource type
                                   NULL,                          // Host node
                                   nControlCodeIn,                // Control code    
                                   NULL,                          // InBuffer
                                   0,                             // Size of InBuffer
                                   resourceEntry->buf,            // OutBuffer
                                   resourceEntry->size,           // Size of OutBuffer
                                   &BytesReturned                 // Actual bytes returned
                                   );                
          resourceEntry->size = BytesReturned;
          break;
     }

     default:
          status = ERROR_INVALID_PARAMETER;
          break;
}
        

Modification Type:MinorLast Reviewed:1/4/2006
Keywords:kbClustering kbDebug kbinfo KB838869 kbAudDeveloper