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

Bug fix: fix wrong log file name checking #182

Merged
merged 1 commit into from
Oct 16, 2018

Conversation

CarpenterLee
Copy link
Contributor

Describe what this PR does / why we need it

DateFileLogHandler.logFileExits() method uses a wrong log file name when checking log file exists, this will lead trying to recreate the log file at every log writing, which will cause performance problem.

Does this pull request fix one issue?

Fixes #181

Describe how you did it

Use the right log file name when exists checking.

Describe how to verify it

  1. Invoke RecordLog.info() in high concurrency;
  2. Use jstack pid to see the stack trace of the current process, then we will see many threads BLOCKED at com.alibaba.csp.sentinel.log.DateFileLogHandler.publish().
  3. After merging this PR, jstack pid, then we will not see threads BLOCKED at com.alibaba.csp.sentinel.log.DateFileLogHandler.publish().

Special notes for reviews

None.

@sczyh30 sczyh30 added the to-review To review label Oct 16, 2018
Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

LGTM

@sczyh30 sczyh30 removed the to-review To review label Oct 16, 2018
@CarpenterLee CarpenterLee merged commit ba10d10 into master Oct 16, 2018
@sczyh30 sczyh30 deleted the bug/log_performance_bug_fix branch October 16, 2018 09:47
@sczyh30 sczyh30 added this to the 1.3.0 milestone Oct 30, 2018
Arlmls pushed a commit to Arlmls/Sentinel that referenced this pull request Jan 8, 2019
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.

Wrong file name used when log file exists checking
2 participants