Menu

#399 ProgramCallDocument Timeout Setting

PCML
open
Zhang Ze
timeout (1)
2
2020-11-17
2018-01-09
Bruce
No

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.

Discussion

  • John Eberhard

    John Eberhard - 2018-02-19
    • assigned_to: wanghuiq
     
  • wanghuiq

    wanghuiq - 2018-02-23
    • assigned_to: wanghuiq --> Zhang Ze
     
  • Zhang Ze

    Zhang Ze - 2018-02-23

    Plan to add setTimeOut(timeout) and getTimeOut() in ProgramCallDocument

     
  • Bruce

    Bruce - 2018-08-30

    Any update on this?

     
  • Zhang Ze

    Zhang Ze - 2018-09-05

    Internal code review and testing.

     
  • Bruce

    Bruce - 2019-02-22

    Any update on this? This has been open for over a year and in code review/testing for almost 6 months.

     
  • Zhang Ze

    Zhang Ze - 2019-02-25

    I have comitted the code changes in JTOpen 9.8, I plan to release the JTOpen 9.8 in March.

     
  • Peter Speck

    Peter Speck - 2020-11-17

    The timeout is not propagated:

    In PcmlDocument.callProgram

            this.m_pcmlProgram = this.getProgramNode(var1);
            return this.m_pcmlProgram.callProgram(this.m_as400);
    

    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:

            this.m_pcmlProgram = this.getProgramNode(var1);
            this.m_pcmlProgram.setTimeout(this.getTimeout());
            return this.m_pcmlProgram.callProgram(this.m_as400);
    
     

    Last edit: Peter Speck 2020-11-17

Log in to post a comment.

MongoDB Logo MongoDB