[Linux-ha-dev] DB2 agent patch 2/3: Guard against hanging db2stop

Holger.Teutsch at web.de Holger.Teutsch at web.de
Fri Nov 5 03:05:08 MDT 2010


-----Ursprüngliche Nachricht-----
Von: "Dejan Muhamedagic" <dejanmm at fastmail.fm>
Gesendet: Nov 4, 2010 4:16:09 PM
An: "High-Availability Linux Development List" <linux-ha-dev at lists.linux-ha.org>
Betreff: Re: [Linux-ha-dev] DB2 agent patch 2/3: Guard against hanging	db2stop

>Hi,
>
>On Thu, Nov 04, 2010 at 09:31:04AM +0100, Holger.Teutsch at web.de wrote:
>> # HG changeset patch
>> # User Holger Teutsch <holger.teutsch at web.de>
>> # Date 1288857475 -3600
>> # Node ID 2ff375ca321554cf146bcf5be197f73fcbe28975
>> # Parent  554ebfef6e9513178ea04cc4093710b65311934a
>> Guard against a hanging db2stop by spawning this into the background. Use db2_kill after grace period.
>> 
>> diff -r 554ebfef6e95 -r 2ff375ca3215 heartbeat/db2
>> --- a/heartbeat/db2    Thu Nov 04 08:53:37 2010 +0100
>> +++ b/heartbeat/db2    Thu Nov 04 08:57:55 2010 +0100
>> @@ -211,16 +211,11 @@ db2_start() {
...
>> +  grace_timeout=$((stop_timeout/1250))
>> +
>> +  # start db2stop in background as this may hang
>> +  sh $0 db2_stop_bg &
>
>This should be OK:
>
>  db2_stop_bg &

Done.

>

...
>> +      # let the processes die
>> +      sleep 2
>> +
>> +      if db2_status
>> +      then
>> +          ocf_log info "DB2 UDB instance $1 can not be killed with db2nkill"
>> +          rc=$OCF_ERR_GENERIC
>> +      else
>> +          ocf_log info "DB2 UDB instance $1 is now dead"
>> +      fi
>
>Perhaps safer to wait in a loop until the processes are gone:
>
>     sleep 1
>     while db2_status; do
>         ocf_log info "waiting for DB2 UDB instance $1 processes to exit"
>         sleep 1
>     done
>     ocf_log info "DB2 UDB instance $1 is now dead"
>

I put in something similar but more specific.

>Cheers,
>
>Dejan
>


Once we are through with this I will rebase the multipartition patch.
Regards
Holger
___________________________________________________________
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://movieflat.web.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db2.2
Type: application/octet-stream
Size: 3850 bytes
Desc: not available
Url : http://lists.linux-ha.org/pipermail/linux-ha-dev/attachments/20101105/b94e8b88/attachment-0001.obj 


More information about the Linux-HA-Dev mailing list