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 issue#9953 #9978
Fix issue#9953 #9978
Conversation
…n occurs in the method processWithAccessKeyLogger (#9953)
@@ -141,6 +141,7 @@ private void writeLogQueueToFile(String accessLog, Queue<AccessLogData> logQueue | |||
processWithAccessKeyLogger(logQueue, file); | |||
} | |||
} catch (Exception e) { | |||
logQueue.poll(); |
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 will be better to modify the traversal method of the 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.
It will be better to modify the traversal method of the queue.
Yes, I think so too, but I'm afraid that changing too much code might not be acceptable
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 will be better to modify the traversal method of the queue.
And if you modify the queue traversal methods so processWithAccessKeyLogger two overloaded methods need to be modified
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.
I'm sorry, maybe I didn't express it clearly, you should handle exceptions in processWithAccessKeyLogger, and you also need to dequeue operations. If the queue is not empty, the while
operation will cause the thread to be blocked all the time.
@106umao
eb15113
to
ca800bf
Compare
Are modifications like this acceptable? Changed the way the queue is traversed |
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.
LGTM.
What is the purpose of the change
fix the issue #9953
Brief changelog
Modified the way the logQueue is traversed to ensure that items are removed from the queue before throwing an exception.
修改了logQueue的遍历方式,确保在抛出异常前将item从队列中移除。
Verifying this change
Checklist