New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fabric.decorators.parallel(<str>) yields unexpected behavior #843

Closed
encryptio opened this Issue Feb 27, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@encryptio

encryptio commented Feb 27, 2013

Passing a string to the parallel decorator, as in @parallel(pool_size="4"), causes there to be no pool size limit.

Expected behavior: either convert with int() and Do What I Meant, or raise an Exception and get the user of the decorator to pass the correct type.

This came up at justin.tv when we used @parallel(pool_size=config.get(...)), not realizing that the result was a string.

@bitprophet

This comment has been minimized.

Member

bitprophet commented Feb 27, 2013

Thanks! Confirmed replication of bug. Looks like min(("a string heh", some_int_maybe)) fails to explode here, but also doesn't do any casting, which is why you got no traceback & the wrong behavior. (I honestly don't know what min() is doing to the string here, it's rather curious.)

I explicitly added an int() cast to the line that obtains the final value (before min'ing it with the host list length) and this appears to work correctly. Will post bugfix in a sec.

Also, you have good timing, I was going to push out more releases today anyway -- so 1.5.4 will be out soon.

@bitprophet

This comment has been minimized.

Member

bitprophet commented Feb 27, 2013

Derp, wasn't entirely that simple due to some more bad logic that went undetected thanks to min being a piece of crap. Fixed now; testing + pushing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment