Salesforce

How the Database Watchdog Works?

« Go Back

Information

 
TitleHow the Database Watchdog Works?
URL Name20449
Article Number000122017
EnvironmentProduct: Progress OpenEdge
Version: All supported versions
OS: All supported platforms
Other: WDOG
Question/Problem Description
How does the watchdog process work?
What is the purpose of the Database Watchdog?
What is the watchdog function's role when a shared-memory client terminates?
Why is a user's session still running on the system after the WDOG has disconnected the shared memory client user-slot?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
The purpose of this Article is to clarify that the watchdog process never terminates any shared-memory process. It's responsibility is to cleanup after a process that was directly connected to shared-memory has terminated. 

A fairly common misconception is that when a shared-memory client terminal session crashes or a client session terminates improperly, the user process is terminated and there is no sign of the user in the PROMON utility because the WDOG disconnects the user from shared memory. This is not true.

In actuality, while the Watchdog process has many benefits, this is not part of its functionality. The WDOG process cleans up after a process has terminated. It performs cleanup of the improperly terminated processes by releasing locks, backing out any live transactions and releasing shared-memory locks, and cleaning up remote servers. The watchdog does not however, ever disconnect users it only removes that connection's userid entry from shared memory.  Refer to Article: PROSHUT/PROMON disconnects users from the Database:

Only the PROSHUT command or PROMON utility disconnects the users from the database.

If the processes are still running it is not an issue for PROSHUT. The client process might be connected to several databases and the intent is not for PROSHUT to disconnect them from the other databases at the same time.

Use of the PROSHUT command or PROMON utility to disconnect users removes the user entry from the connected user list in PROMON Option 8 view or the proshut <db> -C list. Then with PROMON Option 1. User Control, the user may still appear if they were disconnected mid transaction processing holding locks / latches in shared memory at the time. For further details refer to Articles: The OS removes terminating processes <PID>:

It is always the Operating System's (OS) job to remove processes, whether they:
  • Disconnect themselves from the database 
  • Are disconnected through PROMON or PROSHUT -C disconnect
  • Have terminated their session otherwise.
The OS network protocol looks for dead remote connections: 

Specifically, this work is performed by the TCP_KEEPALIVE function:
  • By default, the keepalive value is typically set for 2 hours (7,200,000 ms).
  • This means that the OS will not send a kill signal to that process for 2 hours. At that time, if the process does not clean itself up gracefully, the watchdog function does the rest.
  • Setting the keepalive parameter to 10 or 15 minutes is a reasonable time. Refer to Article 00080089, How to configure the Operating System TCP KEEPALIVE   
PROSHUT/PROMON also shut the database down

If connections to the database persist after the database is shutdown with proshut -by, persistent connections could be associated with (UNIX) signal handling that might need to be corrected (such as UNIX shell traps). In this event, there may be a requirement to kill the user process manually as a temporary workaround before restarting the database.

If the PROSHUT command "hangs",it could be a problem with the shutdown protocol. For further advice refer to Articles:
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 6:58 AM

Powered by