[Glass] Garbage Collection , maintenance gem and typical seaside app
Otto Behrens
otto at finworks.biz
Fri May 9 00:29:28 PDT 2014
>> We do this, yes. We run stopUserSessions as well while this is running.
>>
>
> How do you do that Otto? I tried a simple script like this:
>
>
> [
> [
> System beginTransaction.
> System stopUserSessions.
> SystemRepository markForCollection.
> SystemRepository reclaimAll.
> System commitTransaction.
> System resumeLogins.
>
> ] on: Halt, Warning do: [:ex | ex resume]
> ] on: Error do: [:ex2 | ex2 |
> System resumeLogins.
> ex2 pass.
> ]
>
> But #markForCollection complains it cannot log in. So how can I let
> markForCollection to work yet disable/kill other sessions?
Firstly, we make sure that our "service processes" (Fast CGI,
maintenance, others) are stopped. Then we run stopUserSessions in a
separate topaz session to make sure nobody else is logged in. We then
start a new topaz session to do the markForCollection & reclaimAll.
There are race conditions where a process can slip in (via cron or
something else), so I don't think what we have is perfect. I also
think we should be calling suspendLogins just before MFC & reclaimAll,
which is supposed to suspend other logins (besides our current
process).
Sorry, things changed a bit between versions and I'm not sure what the
best way is to get this right. My intention is to make sure as few
processes are logged in as possible so that the MFC is as efficient
and complete as possible (sessions logged in may just misbehave and
hold onto things that they are not supposed to). Sessions logged in
concurrently have to vote before objects are promoted to possibly
dead.
We do this once a day and take a full backup after this.
More information about the Glass
mailing list