When calling a PCML program we use ProgramCallDocument. We would like a way to use a timeout that if a ProgramCall takes too long to runt that it terminates. Currently it appears that ProgramCall itself supports a timeout parameter, however, there is no way to get to it from a ProgramCallDocument. If a program gets stuck for 10 minutes it will cause hung thread exceptions.
[1/8/18 12:13:49:462 EST] 000003f7 ThreadMonitor W WSVR0605W: Thread "SoapConnectorThreadPool : 0" (000003ef) has been active for 666074 milliseconds and may be hung. There is/are 1 thread(s) in total in the server that may be hung.
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:167)
at com.ibm.as400.access.AS400ThreadedServer.receive(AS400ThreadedServer.java:339)
at com.ibm.as400.access.AS400ThreadedServer.sendAndReceive(AS400ThreadedServer.java:492)
at com.ibm.as400.access.RemoteCommandImplRemote.runProgramOffThread(RemoteCommandImplRemote.java:563)
at com.ibm.as400.access.RemoteCommandImplRemote.runProgram(RemoteCommandImplRemote.java:532)
at com.ibm.as400.access.ProgramCall.run(ProgramCall.java:760)
at com.ibm.as400.data.PcmlProgram.callProgram(PcmlProgram.java:681)
at com.ibm.as400.data.PcmlDocument.callProgram(PcmlDocument.java:462)
at com.ibm.as400.data.ProgramCallDocument.callProgram(ProgramCallDocument.java:445)
Is there anyway to expose the timeout so that a timeout could be sent into the ProgramCallDocument so that the ProgramCall can use the tmieout to prevent ProgramCalls from getting hung. When it is hung it can cause issues with servers ending normally.
Hopefully I am interrupting the timeout setting in the ProgramCall properly in that this would help satisfy this issue.
Plan to add setTimeOut(timeout) and getTimeOut() in ProgramCallDocument
Any update on this?
Internal code review and testing.
Any update on this? This has been open for over a year and in code review/testing for almost 6 months.
I have comitted the code changes in JTOpen 9.8, I plan to release the JTOpen 9.8 in March.
The timeout is not propagated:
In PcmlDocument.callProgram
does not propagate this.m_timeOut to this.m_pcmlProgram.setTimeout(), so the call is always executed without timeout as PcmlDocNode.m_timeOut defaults to 0 and PcmlDocNode.setTimeOut() is not called.
The two lines should be expanded to:
Last edit: Peter Speck 2020-11-17