Subject Re: [Firebird-Architect] Shutdown Call, take 2
Author Jim Starkey
Arno Brinkman wrote:

>Hi,
>
>
>
>>The call:
>>
>> int fb_shutdown (int type, int milliseconds);
>>
>>where "type" is one of:
>>
>> * fb_shutdown_count -- just return number of active connections
>> * fb_shutdown_attachments -- block new attachments, wait (see below)
>> for pending to exit
>> * fb_shutdown_transactions -- block new attachments and transaction,
>> wait for pending to finish
>> * fb_shutdown_verbs -- block new calls, wait for pending to finish
>> * fb_shutdown_immediate -- stop pending verbs w/ clean error
>> * fb_shutdown_panic -- shutdown as fast as cleanly possible
>>
>>and "milliseconds" is a period to wait, where milliseconds < 0 means
>>don't wait, milliseconds == 0 means wait indefinitely, and milliseconds
>> > 0 means wait for that number of milliseconds before timing out.
>>
>>All flavors return the number of active connections.
>>
>>
>
>When wait has been elapsed and there are still attachments. The shutdown is
>canceled i guess or does it then fb_shutdown_immediate ?
>
>
No, shutdown remains pending and the number of lingering connections is
returned. I expect that many will use variations on the following:

if (fb_shutdown (fb_shutdown_attachments, 500) &&
fb_shutdown (fb_shutdown_transactions, 500) &&
fb_shutdown (fb_shutdown_verbs, 500))
fb_shutdown (fb_shutdown_panic, 0);

This give nice guys a chance to shutdown smoothly while still getting
the job down.

--

Jim Starkey
Netfrastructure, Inc.
978 526-1376