-
Notifications
You must be signed in to change notification settings - Fork 307
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
HPCC-33655 Fix possible LOCK_EVASION in dafileserver #19623
base: master
Are you sure you want to change the base?
HPCC-33655 Fix possible LOCK_EVASION in dafileserver #19623
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-33655 Jirabot Action Result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@streeterd - please see comments.
fs/dafsserver/dafsserver.cpp
Outdated
clientcounttick = msTick(); | ||
MaxClientCount = ClientCount; | ||
if (closedclients) | ||
if (msTick() - clientcounttick > 1000 * 60 * 60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the write to clientcounttick was tested outside the crit, and altered in it, but it didn't need protecting. ClientCountSect is really only protecting concurrency to ClientCount and MaxClientCount.
It would be better to move the clientcounttick, to just after the if, and scope this crit around the ClitnCount/MaxClientCount code, i.e.:
clientcounttick = msTick();
{
CriticalBlock block(ClientCountSect);
if (TF_TRACE_CLIENT_STATS && (ClientCount || MaxClientCount))
PROGLOG("Client count = %d, max = %d", ClientCount, MaxClientCount);
MaxClientCount = ClientCount;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be worth noting somewhere that clientcounttick and closedclients are members only touched/read by checkTimeout() that is not contended itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- fs/dafsserver/dafsserver.cpp: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@streeterd - 1 minor issue.
if (TF_TRACE_CLIENT_STATS) | ||
PROGLOG("Closed client count = %d", closedclients); | ||
closedclients = 0; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other end of block brace added, not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- fs/dafsserver/dafsserver.cpp: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- fs/dafsserver/dafsserver.cpp: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@streeterd - 1 trivial comment, can yo address and squash?
fs/dafsserver/dafsserver.cpp
Outdated
{ | ||
CriticalBlock block(ClientCountSect); | ||
if (TF_TRACE_CLIENT_STATS && (ClientCount || MaxClientCount)) | ||
PROGLOG("Client count = %d, max = %d", ClientCount, MaxClientCount); | ||
clientcounttick = msTick(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial: should have made observation before - would be more logical to reset this time at the end of the if block.
Ensure clientcounttick is tested and reset outside of ClientCountSect. Signed-off-by: Dave Streeter <[email protected]>
a22ce1b
to
1b03e84
Compare
@jakesmith PR comment implemented and commits squashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@streeterd - looks good.
Type of change:
Checklist:
Smoketest:
Testing: