← Back to team overview

launchpad-dev team mailing list archive

Re: Cached WADL corruption

 

On Mon, Sep 26, 2011 at 8:04 PM, Benji York <benji.york@xxxxxxxxxxxxx> wrote:
> On Mon, Sep 26, 2011 at 2:14 PM, Gary Poster <gary.poster@xxxxxxxxxxxxx> wrote:
>> I think this constraint comes from httplib2.
>
> After looking at the lazr.restfulclient and launchpadlib code, I can
> confirm this.  The problem is that httplib2 doesn't make the effort to
> mutate cache files atomically.
>

Thanks.

>> Maybe httplib2 can be subclassed [...]
>
> Another workaround would be to provide a unique value for
> launchpadlib_dir (perhaps the result of a call to tempfile.mkdtemp) to
> each invocation of login_anonymously.
>
> You will loose some of the benefits of the cache, but if each worker is
> relatively long-lived, the overall performance should be reasonable.
>

The workers are actually quite short-lived, but maybe that will have to do.

Thanks again,
jml


References