launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #03351
Re: Connections left open after switching to read only mode
On Fri, May 7, 2010 at 8:28 PM, Guilherme Salgado <salgado@xxxxxxxxxxxxx> wrote:
> The latter should work as long as the ROMDP returns the romode store
> (pointing to the standalone DB) rather than the regular slave one as it
> currently does. The ROMDP is already installed by beforeTraversal() (so
> we'll still be able to switch the web app to read-only without
> restarting) but as you said we'll need to install that policy on
> startup, for things like the librarian.
>
> We also need to make sure that all DatabasePolicies can detect a mode
> change and close the stores used by the previous mode, so that we don't
> leave open connections behind.
Hmm... yeah. All the DatabasePolicies would need to know about RO
mode, which sucks. Instead, we could just do this in the
IStoreSelector - if read-only mode is detected, ignore any installed
DatabasePolicy and return the read-only Stores.
--
Stuart Bishop <stuart@xxxxxxxxxxxxxxxx>
http://www.stuartbishop.net/
Follow ups
References