Skip to content

fix: ostime #28195

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

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: semphore leak
  • Loading branch information
facetosea committed Sep 29, 2024
commit 5a85303c373441ef778f6a9f66de7b91b027a7cc
9 changes: 7 additions & 2 deletions source/libs/catalog/src/ctgCache.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
if (gCtgMgmt.queue.stopQueue) {
ctgFreeQNode(node);
CTG_UNLOCK(CTG_WRITE, &gCtgMgmt.queue.qlock);
CTG_RET(TSDB_CODE_CTG_EXIT);
CTG_ERR_JRET(TSDB_CODE_CTG_EXIT);
}

gCtgMgmt.queue.tail->next = node;
Expand All @@ -924,7 +924,7 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
code = tsem_post(&gCtgMgmt.queue.reqSem);
if (TSDB_CODE_SUCCESS != code) {
qError("tsem_post failed, code:%x", code);
CTG_RET(code);
CTG_ERR_JRET(code);
}

if (syncOp) {
Expand All @@ -935,9 +935,14 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
if (!operation->unLocked) {
CTG_LOCK(CTG_READ, &gCtgMgmt.lock);
}
tsem_destroy(&operation->rspSem);
taosMemoryFree(operation);
}

_return:
if (syncOp) {
tsem_destroy(&operation->rspSem);
}
return code;
}

Expand Down