Skip to content
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

Merged
merged 3 commits into from May 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -141,6 +141,7 @@ private void writeLogQueueToFile(String accessLog, Queue<AccessLogData> logQueue
processWithAccessKeyLogger(logQueue, file);
}
} catch (Exception e) {
logQueue.poll();
Copy link
Member

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.

Copy link
Author

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

Copy link
Author

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

Copy link
Member

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

logger.error(e.getMessage(), e);
}
}
Expand Down