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

Fix issue#9953 #9978

merged 3 commits into from May 7, 2022

Conversation

106umao
Copy link

@106umao 106umao commented Apr 28, 2022

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

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

…n occurs in the method processWithAccessKeyLogger (#9953)
@106umao 106umao changed the base branch from 3.0 to master April 28, 2022 12:56
@106umao 106umao changed the title Up dev issue#9953 Fix issue#9953 Apr 28, 2022
@@ -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

@106umao
Copy link
Author

106umao commented Apr 29, 2022

Are modifications like this acceptable? Changed the way the queue is traversed

Copy link
Contributor

@chickenlj chickenlj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants