Bug 215562 - service script shutdown functions have sleep statements - check status instead
Summary: service script shutdown functions have sleep statements - check status instead
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: conga
Version: 5.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Stanko Kupcevic
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-14 17:18 UTC by Len DiMaggio
Modified: 2009-04-16 22:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-12-12 15:36:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.