Java (Java Agent, Installation, JVM, and Controller Installation)

cancel
Showing results for 
Search instead for 
Did you mean: 

Originating vs Continuing

Highlighted
Producer

Originating vs Continuing

<<Perhaps a forward...  I am trying to simulate load so we can learn how app dynamics works so all of my 'services' are different threads in the same process.>>

 

I know when a transaction come from the outside and when it is between separate calls so I tried to use the Originating and Continuing calls to 'link' them together.  I verified that the uid matches on both calls but I must be misunderstanding the concept as this causes the agent and by extension the apm to get confused

 

	if (newTransaction) {
		logger.debug("Starting Original Transaction: {}", uid);
		delegate.beginOriginatingTransactionAndAddCurrentThread(getKey(), uid);
	} else {
		logger.debug("Starting Continuing Transaction: {}", uid);
		delegate.beginContinuingTransactionAndAddCurrentThread(getKey(), uid);
	}

Similarly I end with one of these depending on an error occuring:

 

 if(timer.isNewTransaction()) {
logger.debug("Ending Originating Transaction");
delegate.endOriginatingTransactionAndRemoveCurrentThread();
} else {
logger.debug("Ending Continuing Transaction");
delegate.endContinuingTransactionAndRemoveCurrentThread();
}

if(timer.isNewTransaction()) {
logger.debug("Ending Originating Transaction");
delegate.endOriginatingTransactionAndRemoveCurrentThread(lastError, e.getCause());
} else {
logger.debug("Ending Continuing Transaction");
delegate.endContinuingTransactionAndRemoveCurrentThread(e.getCause());
}

 

The agent starts throwing errors:

 

 

[qtp1408043496-83] 22 Jan 2019 08:54:49,659 WARN AgentErrorProcessor - Agent error occurred, [name,transformId]=[com.singularity.tm.NewTransactionDelegate - java.lang.IndexOutOfBoundsException,2147483647]
[qtp1408043496-83] 22 Jan 2019 08:54:49,659 WARN AgentErrorProcessor - 4 instance(s) remaining before error log is silenced
[qtp1408043496-83] 22 Jan 2019 08:54:49,659 ERROR NewTransactionDelegate - Error in beginContinuingTransactionAndAddCurrentThread with appDynamicsTransactionHeader [TestMethodPerformance_step2], uniqueIdentifierForTransaction [49bb2535-e2cc-3cc9-8bf5-7e7d2aeff590]
java.lang.IndexOutOfBoundsException: Index: -1

[qtp1408043496-96] 22 Jan 2019 08:54:49,668 WARN AgentErrorProcessor - Agent error occurred, [name,transformId]=[com.singularity.tm.NewTransactionDelegate - java.lang.IndexOutOfBoundsException,2147483647]
[qtp1408043496-96] 22 Jan 2019 08:54:49,668 WARN AgentErrorProcessor - 3 instance(s) remaining before error log is silenced
[qtp1408043496-96] 22 Jan 2019 08:54:49,668 ERROR NewTransactionDelegate - Error in beginContinuingTransactionAndAddCurrentThread with appDynamicsTransactionHeader [TestMethodPerformance_step1], uniqueIdentifierForTransaction [49bb2535-e2cc-3cc9-8bf5-7e7d2aeff590]
java.lang.IndexOutOfBoundsException: Index: -1

As additional information if I force newTransaction to true so that I only create Originating transactions (with the passed uid) I get these errors from the agent.  

[qtp1463823265-107] 22 Jan 2019 09:09:27,255 INFO NewTransactionDelegateInternal - endOriginatingTransaction :: Transaction context not associated with this identifier[]. Please make sure beginOriginatingTransaction api is invoked before calling this api 
[qtp1463823265-82] 22 Jan 2019 09:09:27,256 INFO NewTransactionDelegateInternal - endOriginatingTransaction :: Transaction context not associated with this identifier[]. Please make sure beginOriginatingTransaction api is invoked before calling this api
[qtp1463823265-95] 22 Jan 2019 09:09:27,303 INFO NewTransactionDelegateInternal - beginOriginatingTransaction :: End originating transaction was not invoked, forcing the end call before beginning a new one
[qtp1463823265-88] 22 Jan 2019 09:09:27,304 INFO NewTransactionDelegateInternal - beginOriginatingTransaction :: End originating transaction was not invoked, forcing the end call before beginning a new one
[qtp1463823265-95] 22 Jan 2019 09:09:27,364 INFO NewTransactionDelegateInternal - endOriginatingTransaction :: Transaction context not associated with this identifier[]. Please make sure beginOriginatingTransaction api is invoked before calling this api
[qtp1463823265-82] 22 Jan 2019 09:09:27,364 INFO NewTransactionDelegateInternal - endOriginatingTransaction :: Transaction context not associated with this identifier[]. Please make sure beginOriginatingTransaction api is invoked before calling this api
[qtp1463823265-107] 22 Jan 2019 09:09:27,382 INFO NewTransactionDelegateInternal - beginOriginatingTransaction :: End originating transaction was not invoked, forcing the end call before beginning a new one
[qtp1463823265-79] 22 Jan 2019 09:09:27,396 INFO NewTransactionDelegateInternal - beginOriginatingTransaction :: End originating transaction was not invoked, forcing the end call before beginning a new one
[qtp1463823265-106] 22 Jan 2019 09:09:27,411 INFO NewTransactionDelegateInternal - beginOriginatingTransaction :: End originating transaction was not invoked, forcing the end call before beginning a new one
[qtp1463823265-79] 22 Jan 2019 09:09:27,487 INFO NewTransactionDelegateInternal - endOriginatingTransaction :: Transaction context not associated with this identifier[]. Please make sure beginOriginatingTransaction api is invoked before calling this api
[qtp1463823265-107] 22 Jan 2019 09:09:27,519 INFO NewTransactionDelegateInternal - endOriginatingTransaction :: Transaction context not associated with this identifier[]. Please make sure beginOriginatingTransaction api is invoked before calling this api

 These errors stop when I generate a new uid for every single transaction.

Originating vs Continuing