Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -no_wait switch to gfix -shut [CORE3818] #4160

Open
firebird-automations opened this issue Apr 15, 2012 · 4 comments
Open

Add -no_wait switch to gfix -shut [CORE3818] #4160

firebird-automations opened this issue Apr 15, 2012 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @helebor

When a shutdown is requested with -attach and -tran switches and a non-zero timeout, connection requestors are left waiting until the timeout completes, with no message to explain why they can't connect. This is especially maddening for browser clients on systems that need long timeouts, as they think their browser is "frozen".

The suggestion is to add an -no_wait option to -shut...-attach and -shut -tran, available in both gfix and the equivalent service functions. The option would switch on a "database undergoing shutdown" state immediately the timeout period commences and switch it off on completion of timeout. Attachment or transaction requests should then be refused if this condition were true.

@firebird-automations
Copy link
Collaborator Author

Modified by: @helebor

summary: Add -immediate switch to gfix -shut => Add -no_wait switch to gfix -shut

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

Why would that need an extra switch? I think that behaviour you describe is the logical one for a shutdown. So make that behaviour implicit to the shutdown functionality.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I'd say this should be the only possible behavior. And as far as I see, it already works this way for -shut -tran. Only -shut -attach waits for the timeout to elapse.

@firebird-automations
Copy link
Collaborator Author

Commented by: @helebor

OK, apparently I didn't express the situation very well for Mark Rotteveel. With the current situation, the requestors wait until the timeout has elapsed; then, if an existing connection is still connected ( in the case of -attach) or an existing transaction is still running (in the case of -tran), the shutdown fails and the waiting requests will succeed. So your assumption of the implicit behaviour is incorrect. The current behaviour is OK for systems that can tolerate a client freeze with no error message. It is not tolerable for browser-based clients, since there is normally no way to warn them ahead and ask them not to log in.

What I am suggesting is an optional -no_wait switch with the underlying mechanism to send a fail error to the waiting requestors immediately the timeout starts. Their application should interpret that message and tell them to try again later.

Dmitry: yes, perhaps you are right about -tran. It is not behaving correctly in 2.5.1 SC, though, but this is probably due to the "trapped user" causing an irresolvable conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant