Merge lp:~bac/python-memcached/bug-974632 into lp:python-memcached
| Status: | Needs review | ||||
|---|---|---|---|---|---|
| Proposed branch: | lp:~bac/python-memcached/bug-974632 | ||||
| Merge into: | lp:python-memcached | ||||
| Diff against target: |
59 lines (+16/-5) 1 file modified
memcache.py (+16/-5) |
||||
| To merge this branch: | bzr merge lp:~bac/python-memcached/bug-974632 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Sean Reifschneider | 2012-04-06 | Disapprove on 2012-04-11 | |
|
Review via email:
|
|||
Description of the Change
Restore the previous behavior of readline() so that it returns None if the socket is closed. A new internal method _readline() is introduced to provide the uncaught _ConnectionDead
| Brad Crittenden (bac) wrote : | # |
Hi Sean, thanks for looking at this code.
Your comment confuses me a little because the approach you describe as your preferred solution seems to be what I've implemented, that is the readline() method is restored to never throw an exception while the unsafe do call a special method that can raise the exception. I called this new method _readline(), which could've been named better.
Perhaps there are call sites that use _expectvalue that I missed?
Anyway, I'll be happy to review the patch you produce.
| Sean Reifschneider (jafo) wrote : | # |
On 04/11/2012 04:37 AM, Brad Crittenden wrote:
> Your comment confuses me a little because the approach you describe
I guess the simplest explanation I can give is that my patches changes the
semantics back to how they were before Tarek's patch -- exceptions aren't
raised by that code. Only in the cases where the higher-level code
explicitly requests the exceptions are they generated.
I don't recall exactly what I saw that I thought might still leak
exceptions, but it just "felt right" this way, basically reverting to the
old behavior, regarding exception generation.
Thoughts?
Thanks,
Sean
Unmerged revisions
- 57. By Brad Crittenden on 2012-04-06
-
Provide a wrapper to handled _ConnectionDead
Errors so that readline() behaves as before.

I think this misses some cases that the current could would also raise an exception in. This is a good start, and helped me understand the problem, thanks for the patch, but I've made some other changes which include restoring the readline() back to not raising an exception in most cases, and the _unsafe_*() functions calling functions which explicitly request that readline() raise the exception.
I'm going to commit a change shortly, would you mind reviewing it and seeing if it fixes the issue?
Thanks,
Sean