Skip to content

HBASE-24686 [LOG] Log improvement in Connection#close - #2219

Merged
virajjasani merged 1 commit into
apache:masterfrom
mokai87:master
Aug 21, 2020
Merged

HBASE-24686 [LOG] Log improvement in Connection#close#2219
virajjasani merged 1 commit into
apache:masterfrom
mokai87:master

Conversation

@mokai87

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 27sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall4m 20smaster passed
+1 💚compile0m 29smaster passed
+1 💚shadedjars5m 47sbranch has no errors when building our shaded downstream artifacts.
-0 ⚠️javadoc0m 28shbase-client in master failed.
_ Patch Compile Tests _
+1 💚mvninstall4m 0sthe patch passed
+1 💚compile0m 28sthe patch passed
+1 💚javac0m 28sthe patch passed
+1 💚shadedjars5m 42spatch has no errors when building our shaded downstream artifacts.
-0 ⚠️javadoc0m 26shbase-client in the patch failed.
_ Other Tests _
+1 💚unit1m 9shbase-client in the patch passed.
24m 29s
SubsystemReport/Notes
DockerClient=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#2219
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 0b5a016db29e 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 3edfa10
Default Java2020-01-14
javadochttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-hbase-client.txt
javadochttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-hbase-client.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/testReport/
Max. process+thread count298 (vs. ulimit of 12500)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/console
versionsgit=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 3sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall4m 5smaster passed
+1 💚compile0m 24smaster passed
+1 💚shadedjars6m 7sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 23smaster passed
_ Patch Compile Tests _
+1 💚mvninstall3m 46sthe patch passed
+1 💚compile0m 23sthe patch passed
+1 💚javac0m 23sthe patch passed
+1 💚shadedjars6m 2spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 21sthe patch passed
_ Other Tests _
+1 💚unit1m 8shbase-client in the patch passed.
24m 46s
SubsystemReport/Notes
DockerClient=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#2219
Optional Testsjavac javadoc unit shadedjars compile
unameLinux ae29f06a63ea 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 3edfa10
Default Java1.8.0_232
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/testReport/
Max. process+thread count221 (vs. ulimit of 12500)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/console
versionsgit=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 25sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall3m 38smaster passed
+1 💚checkstyle0m 28smaster passed
+1 💚spotbugs1m 1smaster passed
_ Patch Compile Tests _
+1 💚mvninstall3m 20sthe patch passed
+1 💚checkstyle0m 26sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck10m 53sPatch does not cause any errors with Hadoop 3.1.2 3.2.1.
+1 💚spotbugs1m 7sthe patch passed
_ Other Tests _
+1 💚asflicense0m 13sThe patch does not generate ASF License warnings.
28m 26s
SubsystemReport/Notes
DockerClient=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#2219
Optional Testsdupname asflicense spotbugs hadoopcheck hbaseanti checkstyle
unameLinux f066bc09a580 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 3edfa10
Max. process+thread count94 (vs. ulimit of 12500)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2219/1/console
versionsgit=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) spotbugs=3.1.12
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@pankaj72981pankaj72981 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@pankaj72981

Copy link
Copy Markdown
Contributor

@busbey please have a look.

if (!closed.compareAndSet(false, true)) {
return;
}
LOG.info("Connection has been closed by {}.", Thread.currentThread().getName());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should also be at debug level.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It is helpful to identify who closed the connection improperly in production env.
Level debug is inconvenient since we have to re-run the user application to reproduce it. Meanwhile, it should not be called frequently.
Maybe I did not get your concern.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd also like to keep this at INFO. Connection objects are supposed to be long lived so we should see this message rarely. Ideally once per cluster per JVM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't mean to correlate with no of occurrences of this log, I meant to say user who is interested to know which thread closed the connection would also likely want to check out call stacktrace. So if call stack is at debug level, let's also keep thread name at debug level.

But yeah, not everyone enables debug log for production use-case and hence, maybe we should keep both at info level? Stacktrace is also equally interesting right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for lack of clarification in previous comment. Also, changes look good, just that once we have both at info level, we should be good to go ahead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh wait, how about first we gather stack trace and then log both threadname and stacktrace together in same log?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I think the stacktrace is an option if the thread name is helpless. It's almost enough with meaningful name. I'm also worried log stack at info level is confusing since the format is like an exception.

@virajjasanivirajjasaniAug 15, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm also worried log stack at info level is confusing since the format is like an exception.

Even though it is Exception, but we do want to log which Exception caused Connection closure (once in a while) right? If so, then keeping threadname at info level and stacktrace at debug somehow doesn't fit well IMHO.
If we know for certain that threadname is useful to get sufficient info, then we should not log stacktrace at all, and if stacktrace is required for debugging, then it should be at the same level as threadname.

Level debug is inconvenient since we have to re-run the user application to reproduce it.

This is exactly applicable to stacktrace also. If application is running with info level and if threadname is not sufficient to know the cause, then we can't get stacktrace either because our application was running with info level at that time and stacktrace is present at debug level in code. ¯\_(ツ)_/¯

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For background, I left a longer comment awhile ago on HBASE-24686 where I asked for some indication of the close at info and the stack trace at debug.

we already have other things that get logged at INFO when a connection is closing, but it's incidental and could happen in other ways. so an INFO message that clearly demarcates connection close is a thing I really want from this change. Enough so that I am sure I'll be back requesting it again the very next time I run into a production problem where I don't see the message, because almost no one I support runs DEBUG in production as a matter of course. Most of the times where this log message would have helped me in the last ~6 months the thread name and an unambiguous "we closed the connection" would suffice.

the stack trace would help with a specific problem we hit in a dev set up with an apparent bug in the hmaster. It did not happen often but it did happen regularly, so changing the log level to DEBUG to see a stack trace would have worked fine for us.

If you feel strongly about not having the messages at different log levels, @virajjasani, I'd rather see both at INFO then both at DEBUG, even though I generally am against non-error related stack traces at log levels above DEBUG.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most of the times where this log message would have helped me in the last ~6 months the thread name and an unambiguous "we closed the connection" would suffice.

That's perfectly fine, if thread name is enough for prod env and if we have a way to repro in dev env, we can let stacktrace be at debug. The only thing I was concerned about was whether not finding stacktrace in prod env would still keep things unclear for user. However, here I believe once we get the thread name, we can find recent logs of that thread to find more.

I generally am against non-error related stack traces at log levels above DEBUG.

+1 for this unless the non-error trace is useful for detailed debugging, in which case maybe we can write something specifically to indicate to not treat this as erroneous condition.
However, for our current PR, it seems thread-name is most likely going to provide sufficient info.

@virajjasanivirajjasani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@mokai87

Copy link
Copy Markdown
ContributorAuthor

@busbey@pankaj72981@virajjasani Thanks for the reviews. Who can help to merge this PR if there is no more comment?

@virajjasani

virajjasani commented Aug 17, 2020

Copy link
Copy Markdown
Contributor

@busbey just to confirm, you have +1 for this PR right? (I mean no other concerns than DEBUG and INFO level discussions)

@virajjasani
virajjasani merged commit 72be041 into apache:masterAug 21, 2020
virajjasani pushed a commit that referenced this pull request Aug 21, 2020
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
virajjasani pushed a commit that referenced this pull request Aug 21, 2020
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
virajjasani pushed a commit that referenced this pull request Aug 21, 2020
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
clarax pushed a commit to clarax/hbase that referenced this pull request Nov 15, 2020
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
wchevreuil pushed a commit to wchevreuil/hbase that referenced this pull request May 24, 2021
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
(cherry picked from commit 31fb9fc)
Change-Id: I04f188d582df7c32ad62115beecbb140d3f5b395
Sign up for freeto 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.

5 participants

@mokai87@Apache-HBase@pankaj72981@virajjasani@busbey