Bug 215562

Summary: service script shutdown functions have sleep statements - check status instead
Product: Red Hat Enterprise Linux 5 Reporter: Len DiMaggio <ldimaggi>
Component: congaAssignee: Stanko Kupcevic <kupcevic>
Status: CLOSED DEFERRED QA Contact: Corey Marthaler <cmarthal>
Severity: low Docs Contact:
Priority: low    
Version: 5.0CC: cluster-maint, kanderso, kupcevic, rmccabe
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-12 15:36:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Len DiMaggio 2006-11-14 17:18:33 UTC
Description of problem:
Service script shutdown functions have sleep statements - check status instead

I noticed this while debugging SElinux policy issues and was stopping/starting
the riccis service. The shutdown seemed to stall and I thought there might be
another problem. The cause was an 8 second sleep statement in the shutdown
function of the ricci service script. (The ricci process is killed and then the
script sleeps before deleting the PID files to make sure that all threads have
stopped.)

It's probably safe to reduce the sleep to 3-4 seconds, but why not remove it
altogether and replace it with a loop that sleeps for a second, checks if the
process is running, and then deletes the PID files.

Version-Release number of selected component (if applicable):
ricci-0.8-23.el5

How reproducible:
100%

Steps to Reproduce:
1. Stop the service.

Actual results:
Sleeps for 8 seconds

Expected results:
It could vary depending on system speed/load.



Additional info:

Comment 1 Stanko Kupcevic 2006-11-14 17:55:53 UTC
TCP, by RFC, keeps server socket open until TCP timeout elapses (couple
seconds), so it can handle astrayed incoming messages. Restarts were failing
because of it (it was not enough to check if daemon was still running - new
daemon wasn't able to bind a socket even after old daemon has exited). 

SO_REUSEADDR allows port to be reused before timeout has elapsed. 

Since that has been fixed long time ago, timeouts can go as well (except for
threads to exit, which can be checked in status loop). 


Comment 2 Jim Parsons 2006-12-12 15:36:55 UTC
This request is being deferred until the next version. It is a low priority fix.
Things are working ok the way they are.