deleteLocalRoles times out

Bug #739951 reported by sureshvv
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope CMF buildout
New
Undecided
Unassigned

Bug Description

For a large site with a lot of content, deleteLocalRoles may take a long time and the database connection times out. This can be fixed with a "transaction.commit()" in the loop.

Will be happy to commit the change if approved.

Revision history for this message
sureshvv (sureshvv) wrote :
Revision history for this message
Raphael Ritz (raphael-ritz) wrote :

Wouldn't it be better to set a savepoint (optimistic=True) rather than doing a full commit?
Would that work as well?

Raphael

Revision history for this message
Hedley (hedley-upfrontsystems) wrote :

How does the database connection time out? I'm expecting the browser to time out.

The only reason why the periodic commits seem to prevent timeouts is because it reduces the overall running time required to do deleteLocalRoles. This is expected since periodic commits in such a for-loop reduce overall memory consumption (at the risk of inconsistent data should an error occur during later iterations).

So it is not a global fix. There are a few strategies to handle such a case and they all relate to deferring the heavy operations (thread, cron job etc).

Revision history for this message
Wichert Akkerman (wichert) wrote :

Perhaps it helps prevent ConflictErrors, and thus retries.

Revision history for this message
sureshvv (sureshvv) wrote :

> How does the database connection time out? I'm expecting the browser to time out.

Browser times out sometimes. Database "Connection timed out" happens even before.

> So it is not a global fix.

Agree. Improved things slightly for me. Otherwise the ZEO client becomes useless and needs to be restarted. But will investigate better fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.