Skip to content

Bug fix: fix wrong log file name checking - #182

Merged
CarpenterLee merged 1 commit into
masterfrom
bug/log_performance_bug_fix
Oct 16, 2018
Merged

Bug fix: fix wrong log file name checking#182
CarpenterLee merged 1 commit into
masterfrom
bug/log_performance_bug_fix

Conversation

@CarpenterLee

Copy link
Copy Markdown
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

@sczyh30 sczyh30 left a comment

Copy link
Copy Markdown
Member

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