cancel
Showing results for 
Search instead for 
Did you mean: 

Endless loop in UDF

r_herrmann
Active Contributor
0 Kudos

I have some questions concerning user defined functions (UDF) in mappings.

  • Is it possible to produce an endless mapping process, by writing an endless loop in the UDF or is there a timeout for mappings?
  • If there is no timeout and I produce an endless loop, how to stop it? Is it possible to stop the "process" which runs the endless udf instance? (If so, is there a way over NWA/Administration or only via terminal?)

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi,

Just to add.

In a sync scenario if you set a timeout at a channel/adapter level this parametrization can help to avoid endless mappings to crash the system:

In asyn cases, at least in a dual system you can configure a timeout o maximum time of processing at IE level, and this would be helpful (check 2.1 and 2.2 points):

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c059d583-a551-2c10-e095-eb5d95e03...

Regards.

Answers (2)

Answers (2)

former_member186851
Active Contributor
0 Kudos

Hello Raffael,

Are you trying to hold the message processing from sometime in the mapping?The below link should help you

And for cancelling the particular message which is delayed you can cancel that  message in RWB.

r_herrmann
Active Contributor
0 Kudos

No, I don't want to delay a message. I just wanted to know, what happens if a UDF runs into an endless loop due to "bad coding". Nevertheless thanks for your help.

former_member186851
Active Contributor
0 Kudos

Hello Raffael,

It will be failure message in PI.

Just try executing one such UDF in Message mapping tab and check.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Raffael,

Usually it will crash the server.

Regards,

Mark

r_herrmann
Active Contributor
0 Kudos

In how far will it "crash" the server, when there is a timeout like described by Inaki Vila?

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Raffael,

So far, I only had experienced it in the mapping test tab. The server has to be restarted. At runtime, I can't say

Regards,

Mark

former_member186851
Active Contributor
0 Kudos

Hello Raffael,

Just try once in message mapping tab, you will get an idea.

iaki_vila
Active Contributor
0 Kudos

Hi Raffael,


Is it possible to produce an endless mapping process, by writing an endless loop in the UDF or is there a timeout for mappings?

AFAIK there is not a timeout for mapping, but there are for example a maximum time of execution inside PI, timeout for adapter waiting, etc. Therefore, you can do and endless loop but a exception will be raised.


If there is no timeout and I produce an endless loop, how to stop it? Is it possible to stop the "process" which runs the endless udf instance? (If so, is there a way over NWA/Administration or only via terminal?)

As I've said there are several controls to avoid one communication have a workproccess eternally.

Regards.

r_herrmann
Active Contributor
0 Kudos

In case there is the following call inside an UDF:

Process p = Runtime.getRuntime().exec(command)


If the command will never return a result, the adapter will raise an timeout exception. Did I understood you correct? If so, will the process started by the UDF also canceled because it's a child process of the UDF's process or do I have to cancel the process "p" manually?