LISTSERV mailing list manager LISTSERV 16.5

Help for QSERV-L Archives


QSERV-L Archives

QSERV-L Archives


QSERV-L@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

QSERV-L Home

QSERV-L Home

QSERV-L  May 2014

QSERV-L May 2014

Subject:

Re: concurrency in zookeeper

From:

Jacek Becla <[log in to unmask]>

Reply-To:

General discussion for qserv (LSST prototype baseline catalog)

Date:

Tue, 13 May 2014 22:13:51 -0700

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (65 lines)

Serge

Yup, I was blind and used "finally" instead of "else".
Fixing this looks very promising, I've been running
8 concurrent jobs for a while now with no fatal
problems (eg many collisions, but everything recovered
and retried)

thanks,
Jacek





On 05/13/2014 09:56 PM, Serge Monkewitz wrote:
> Jacek,
>
>     Two things. First of all, notice that in :
>
>> def createIt(zk, k, v):
>>    while True:
>>        try:
>>            print "create ", v
>>            zk.create(k, v, ephemeral=True, makepath=True)
>>        except:
>>            print "create failed"
>>            sleepABit()
>>        finally:
>>            print "create ok"
>>            return
>
> your loop will only ever execute once (since the finally clause is
> executed no matter what). So you will return immediately if the creation
> fails (and yet still print “create ok”). You probably meant to use a
> try/except/else construct rather than try/except/finally?
>
> Anyway, the consequence of that is that your code then admits the
> following sequence of events:
>
>    Process A          | Process B
>    ===================| ==================
> 1.                   | createIt (fails)
> 2. delete (success)  |
> 3. createIt (success)|
> 4.                   | delete (success)
> 5.                   | createIt (success)
> 6. get (value from B)|
> 7.                   | delete (success)
> 8. delete (failure)  |
> which seems to be what you are observing in your log (process A).
>
> Either create needs to wait indefinitely for success, or you need to
> make sure not to delete k if you didn’t successfully create it.
>
> Cheers,
> Serge
>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the QSERV-L list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

March 2018
February 2018
January 2018
December 2017
August 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use