Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
libpcp: unlock context before returning #50
Conversation
|
Looks good Ryan, thanks. I've pulled your commit into my tree and it will flow back to github via pcp.io in due course. This is a pretty unlikely code path (calling pmGetArchiveLabel() when the current context is valid, but not an archive) and I would expect none of our code can actually be persuaded to do this, so I am curious if you actually observed the problem that this patch fixes, or noticed by code inspection, or have some devious test harness and lock audit tool that exposed the logic error. Anyway, thanks for improving the correctness and robustness of the code. |
kmcdonell
closed this
Nov 9, 2015
|
Hi Ken Its true that its an unlikely code path. I discovered it while in the process of writing Ruby bindings (still a work in progress!). I have test cases for local and archive contexts which test both success and error conditions. If you're interested, I have a WIP branch called |
ryandoyle commentedNov 9, 2015
If called in a non-archive context, the context ctxp->lock c_lock is
never unlocked.