-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix request processor endless loop #90
Fix request processor endless loop #90
Conversation
eee45f5
to
8e6114d
Compare
d5b7677
to
8ebc875
Compare
8ebc875
to
7f403e1
Compare
The CI error is data race and will be fixed here #90 |
src/Service/RequestProcessor.cpp
Outdated
processCommittedRequest(committed_request_size); | ||
|
||
/// 3. process error requests | ||
processErrorRequest(); |
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.
Need to get the number of current errors in advance, before moving to the pending queue, so as to ensure that the processed errors have been added to the pending queue.
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.
Now errors is a map, we can't handle n items in order, we can use list instead of map to hold errors.
if (found_error) | ||
LOG_WARNING(log, "Found error request, We should terminate the processing of committed(write) requests."); | ||
else | ||
process_not_in_pending_queue(); |
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.
May previous request is error but not in errors queue yet, may we need traverse pending queue to judgement commit request whether in pending queue.
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.
Here first_pending_request.request->xid != committed_request.request->xid
, maybe there is no need to traverse pending queue.
* Fix request processor endless loop * Fix typo * Use list for errors
* Fix request processor endless loop * Fix typo * Use list for errors
Which issues of this PR fixes:
This PR try to fix #89
Change log:
KeeperCommon.h
which contains common prototypes such asRequestForSession
KeeperCommon.h
toKeeperUtils.h
RequestId
instead of UInt28(session_id, xid)sessionCleanerTask
will notfinishSession