killing Vs disconnecting

TomBascom

Curmudgeon
"Disconnect" is when Progress manages the termination and cleanup of a session. Internally it may involve sending "kill" signals at various times.

"kill" is sending a signal from the OS to the client. The client's signal handler will then attempt to do whatever is appropriate based on which signal was sent. There are 4 main signals of interest:

HUP -- "hangup", this is equivalent to a user closing their window. It is the default when a signal is not otherwise handled by Progress. This should result in the session being terminated and cleaned up without incident. Usually "kill -1". You should be able to use kill -1 safely and without concern.

INT -- "interrupt", this raises the STOP condition in the 4GL client. It can sometimes be used to revive a "hung" session. It does not terminate the session or disconnect it. Usually "kill -2". This is the "gentlest" signal to send -- think of it as a tap on the shoulder to wake up a sleepy worker ;)

TERM -- "terminate". On a Progress client it mostly acts like HUP and results in the session being disconnected. Generally "kill -15". Unfortunately it shows up in the .lg file as "KILL" which is confusing -- people think that it means that Progress has figured out a way to handle "kill -9".

KILL -- "kill". This is not trappable. No matter what you think you saw in the .lg file. It is always signal #9. It kills the target process immediately. Without any cleanup. Which means that it might cause the db to crash because one of the things that cannot be cleaned up is shared memory. If a session is killed with -9 then it might be holding a latch. Since it cannot clean that up (that's what "untrappable" means...) nobody else can get any work done -- eventually everyone will queue on that latch. The server cannot clean it up because the operation being protected by the latch was using values private to the no longer existing process. So the server (or WDOG) will eventually notice that a latch is being held by a process that does not exist and do the only sensible thing -- shutdown the database. When this happens you see various messages in the .lg file about latches, microtransactions and such. (Details vary depending on the specific latch and the version of Progress).

There is a myth that "kill -9" is good because "it always works". This is not true. Both parts ;) It is not "good" -- as explained above it can crash your db... and it doesn't "always work" either. Kill -9 can not kill processes that are hung in certain system calls. A relatively common case is IO calls that are hanging due to hardware failures. Administrators of Progress based systems should never use "kill -9".

There are many signals and the signal numbers can vary from OS to OS. Use "kill -l" (lower case ell) to get a list on your system. Windows has similar functionality except that your only option is "kill -9". So don't use it.

For more information: http://dbappraise.com/traps.html
 

vijayakiran.m

New Member
when the clients asked me to kill the user i will be using this command
[proshut dbname -C list | grep "userno"]

where as when they asked me to disconnect the user i will be using this command
[promon dbname]

or

[proshut dbname]

then will get the options i will select the 1st option and i will disconnect the user.

my question is where is any difference among them.

Regards,
vijaya.
 

TomBascom

Curmudgeon
Your first command does nothing about killing or disconnecting anyone. It just gives you some information about a user who matches "userno".

The other two end up being the same thing. Both the PROMON and PROHUT scripts run the same executable (_mprshut). You then follow various menu items to disconnect the user.

The short answer: No, there is no difference in the way that these commands which you have shown disconnect users.
 
Top