Skip to content

Conversation

JamesWSWu
Copy link
Contributor

@JamesWSWu JamesWSWu commented Jul 29, 2025

When the lock timer creation fails, we may delete lock_obj. To prevent permanent occupation by lock owners

Fixes: #4603

@JamesWSWu
Copy link
Contributor Author

@atinmu @sanjurakonde
please review it.
Thanks!

@JamesWSWu JamesWSWu force-pushed the issue4603 branch 2 times, most recently from c236f8b to 5d2e8f6 Compare July 29, 2025 06:07
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
"Unable to set timer in mgmt_v3 lock");
keylen = strlen(key_dup);
dict_deln(priv->mgmt_v3_lock, key_dup, keylen);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you also free 'lock_obj' ?

nit: the whole keylen and such and using dict_deln() - you could just use dict_del()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mykaul I have made modifications based on the suggestions. Please review it again.
Thanks!

Signed-off-by: 10255046 <[email protected]>
@JamesWSWu JamesWSWu requested a review from mykaul July 29, 2025 08:15
@JamesWSWu JamesWSWu marked this pull request as draft July 30, 2025 08:44
@JamesWSWu JamesWSWu marked this pull request as ready for review July 30, 2025 08:46
@JamesWSWu JamesWSWu closed this Sep 9, 2025
@JamesWSWu JamesWSWu reopened this Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The lock will be held indefinitely and cannot be released
2 participants