Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 11588011: Spread out sitescript pulls to avoid hgweb bug (Closed)

Created:
Sept. 3, 2013, 1:01 p.m. by Felix Dahlke
Modified:
Nov. 12, 2013, 10:13 a.m.
Reviewers:
Wladimir Palant
Visibility:
Public.

Description

This is a workaround for a race condition in hgweb: http://bz.selenic.com/show_bug.cgi?id=3953 I looked a bit into fixing this, but it's definitely non-trivial. So I came up with a crude workaround instead. Note that sitescripts is not the only thing we pull, so we're probably going to see this again as we add more servers. Might make sense to have a script that handles updating and put the logic there.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M modules/sitescripts/manifests/init.pp View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 6
Felix Dahlke
Sept. 3, 2013, 1:07 p.m. (2013-09-03 13:07:21 UTC) #1
Wladimir Palant
Judging by the lack of further error mails - LGTM :) However, I strongly disagree ...
Sept. 3, 2013, 1:34 p.m. (2013-09-03 13:34:00 UTC) #2
Wladimir Palant
I actually patched /usr/lib64/python2.7/site-packages/mercurial/ui.py now. At the top I added: import thread config_lock = thread.allocate_lock() ...
Sept. 3, 2013, 1:46 p.m. (2013-09-03 13:46:56 UTC) #3
Felix Dahlke
On 2013/09/03 13:46:56, Wladimir Palant wrote: > I actually patched /usr/lib64/python2.7/site-packages/mercurial/ui.py now. At > the ...
Sept. 3, 2013, 1:59 p.m. (2013-09-03 13:59:14 UTC) #4
Wladimir Palant
I've updated Mercurial which replaced my fix of course. So I've added the following code ...
Oct. 1, 2013, 9:45 a.m. (2013-10-01 09:45:08 UTC) #5
Felix Dahlke
Oct. 1, 2013, 2:07 p.m. (2013-10-01 14:07:33 UTC) #6
On 2013/10/01 09:45:08, Wladimir Palant wrote:
> I've updated Mercurial which replaced my fix of course. So I've added the
> following code to our hgwebdir.fcgi (not part of the Mercurial distribution,
> based on an example of how Mercurial should be run):
> 
> # Serialize ui.setconfig() accesses to avoid hitting
> http://bz.selenic.com/show_bug.cgi?id=3953
> from mercurial.ui import ui
> import thread
> 
> config_lock = thread.allocate_lock()
> orig_setconfig = ui.setconfig
> 
> def new_setconfig(*args, **kwargs):
>   with config_lock:
>     orig_setconfig(*args, **kwargs)
> 
> ui.setconfig = new_setconfig
> 
> This should survive future Mercurial updates.

LGTM

Powered by Google App Engine
This is Rietveld