Skip to content

Fix bug on PMGDQueryHandler which locks the graph#4

Closed
luisremis wants to merge 1 commit intomasterfrom
hotfix-1.0.2
Closed

Fix bug on PMGDQueryHandler which locks the graph#4
luisremis wants to merge 1 commit intomasterfrom
hotfix-1.0.2

Conversation

@luisremis
Copy link
Copy Markdown
Contributor

PMGDQueryHandler hangs when there is a fail command. This fixed the problem, but @vishakha041 please check if this is the right way to handle it.

@luisremis luisremis added the Bug Indicates unexpected or undesired behaviors label Feb 27, 2018
throw e;
}

if (retval < 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed here. It can go in the error_cleanup function since we already call it on error return.

Copy link
Copy Markdown
Contributor Author

@luisremis luisremis Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this to error_cleanup won't work. error_cleanup can be called after unlocking _dblock, std::mutex has undefined behavior if you unlock a lock twice.
The safe place to unlock is the same function we lock ( process_query(2) ).

@luisremis luisremis requested a review from philiplantz March 5, 2018 19:53
@vishakha041
Copy link
Copy Markdown
Contributor

I have a separate fix based on Philip's input too. Will create a new pull request.

@vishakha041 vishakha041 closed this Mar 6, 2018
@vishakha041 vishakha041 deleted the hotfix-1.0.2 branch March 6, 2018 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Indicates unexpected or undesired behaviors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants