Properties for detecting infinite loops

There are a set of loop detection properties that you can use to detect and handle infinite loops in services and process instances.

In the 99Local.xml file, there is a loop-detection-duration property for the service engine and one for the BPD engine. The value in each property sets the expected maximum length a service or BPD instance should run in seconds or a value of -1 for an unlimited duration. The two engines differ in what happens when the service or BPD instance exceeds the maximum duration:
  • If a service runs for longer, the service engine either outputs a message to the SystemOut.log or stops the service. The loop-detection-exception property determines which action that the engine takes. If it is set to true, the engine stops the service and generates an exception. By default, this property is set to false.

    The exception is used to notify the BPD instance that contains the service that the service engine has stopped.

  • If a BPD instance runs for longer, the BPD engine outputs a message to the SystemOut.log. An administrator can use this information to suspend or otherwise handle the instance.
Important: As with other customization changes, do not modify the 99Local.xml file directly. Instead, use the 100Custom.xml file to override the default settings. For information, see Changing IBM Process Server properties in 100Custom.xml.
In the 99Local.xml file, the properties for detecting infinite loops look like the following examples:
<service-engine>
	<loop-detection-duration>120</loop-detection-duration>
	<loop-detection-exception>false</loop-detection-exception>
</service-engine>
<bpd-engine>
	<loop-detection-duration>60</loop-detection-duration>
</bpd-engine>
If services are not in an infinite loop but the following messages are in the SystemOut.log, consider changing the loop-detection-duration values for the service engine:
  • CWLLG0872W: Service '{0}' has been running for {1} seconds and might be in an infinite loop.
  • CWLLG0873W: Service '{0}' for instance {1} has been running for {2} seconds and might be in an infinite loop.
  • CWLLG0874E: Service '{0}' was terminated after {1} seconds because it might be in an infinite loop.
  • CWLLG0875E: Service '{0}' for instance {1} was terminated after {2} seconds because it might be in an infinite loop.

If BPD instances are not in an infinite loop but the following message is in the SystemOut.log, consider changing the loop-detection-duration values for the BPD engine: CWLLG0871W: Business process definition (BPD) instance {0} has been running for {1} seconds and might be in an infinite loop.

For example, to change the service engine to stop the service flow after four minutes (240 seconds), add the following code to the 100Custom.xml file:

<server merge="mergeChildren">
	<service-engine merge="mergeChildren">
		<loop-detection-duration merge="replace">240</loop-detection-duration>
		<loop-detection-exception merge="replace">true</loop-detection-exception>
	</service-engine>
</server>