Recovering from an indefinite wait condition
If a distributed thread is hung, an application might be in an indefinite wait condition. For example, an allied thread might wait indefinitely for a response from a remote server location. Another example is a database access thread that waits for a new request from the remote requester location.
Symptoms
An application is in an indefinitely long wait condition. This can cause other Db2 threads to fail due to resources that are held by the waiting thread. Db2 sends an error message to the console, and the application program receives an SQL return code.Environment
Db2 does not respond.Diagnosing the problem
Operator response: To check for very long waits, look to see if the conversation timestamp is changing from the last time it was used. If it is changing, the conversation thread is not hung, but it is taking more time for a long query. Also, look for conversation state changes, and determine what they mean.
Resolving the problem
Operator response:
- Use the DISPLAY THREAD command with the LOCATION and DETAIL options to identify the LUWID and the session allocation for the waiting thread.
- Use the CANCEL DDF THREAD command to cancel the waiting thread.
- If the CANCEL DDF THREAD command fails to break the wait (because the thread is not suspended in Db2), try using VTAM® commands such as VARY TERM,SID=xxx or use the TCP/IP DROP command. For instructions on how to use the VTAM commands and TCP/IP commands, see -CANCEL THREAD (Db2).