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

More logging around Apache client creation & close #655

Merged
merged 5 commits into from
Apr 15, 2020

Conversation

iamdanfox
Copy link
Contributor

Before this PR

@bwaldrep reported a containerized service is throwing a bunch of these:
(traceid d751285fbb945646)

java.lang.IllegalStateException: {throwable0_message}
	at org.apache.http.util.Asserts.check(Asserts.java:34)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.requestConnection(PoolingHttpClientConnectionManager.java:269)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:176)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at com.palantir.dialogue.hc4.ApacheHttpClientBlockingChannel.execute(ApacheHttpClientBlockingChannel.java:79)
	at com.palantir.dialogue.blocking.BlockingChannelAdapter$BlockingChannelAdapterChannel$BlockingChannelAdapterTask.run(BlockingChannelAdapter.java:122)
	at com.palantir.tracing.Tracers$TracingAwareRunnable.run(Tracers.java:501)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.lang.Thread.run(Thread.java:834)

After this PR

==COMMIT_MSG==
ApacheHttpClientChannels prints some debug log lines around creation & close
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Apr 15, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

ApacheHttpClientChannels prints some debug log lines around creation & close

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from ferozco April 15, 2020 20:00
PoolingHttpClientConnectionManager pool,
ResponseLeakDetector leakDetector,
@Nullable ExecutorService executor) {
log.debug("Apache client created", SafeArg.of("name", name));
Copy link
Contributor

@ferozco ferozco Apr 15, 2020

Choose a reason for hiding this comment

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

we already produce a meter with this information internally, not sure if this is necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Metrics come out at a 30second granularity. Also the semantics of the metric produced by WC could change and we wouldn't be able to tell from the graph. This is as close to the 'ground truth' as I think we can get.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think info level is reasonable here

Copy link
Contributor

Choose a reason for hiding this comment

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

ya we'd expect this to happen incredibly infrequently right?

Copy link
Contributor Author

@iamdanfox iamdanfox Apr 15, 2020

Choose a reason for hiding this comment

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

yep - most services don't try to live-reload their security / ssl config, so I'd expect to see this log line once in the lifetime of a server.

@bulldozer-bot bulldozer-bot bot merged commit af5b827 into develop Apr 15, 2020
@bulldozer-bot bulldozer-bot bot deleted the dfox/more-logging branch April 15, 2020 20:38
@svc-autorelease
Copy link
Collaborator

Released 1.22.0

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

Successfully merging this pull request may close these issues.

None yet

4 participants