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

Connection Pool Shutdown Issue #721

Closed
dhaval24 opened this issue Aug 28, 2018 · 2 comments
Closed

Connection Pool Shutdown Issue #721

dhaval24 opened this issue Aug 28, 2018 · 2 comments

Comments

@dhaval24
Copy link
Contributor

Expected behavior

Application should shutdown gracefully when /shutdown endpoint is hit in Spring / SpringBoot Apps.

Actual behavior

When shutting down SpringBoot Application via /shutdown endpoint, I see the following error and application exists with exit code 1

AI: ERROR 28-08-2018 19:18:29.785+0000, 60(ActiveTransmissionNetworkOutput_1-0): Failed to send, unexpected exception.
Stack Trace:
java.lang.IllegalStateException: Connection pool shut down
        at com.microsoft.applicationinsights.core.dependencies.http.util.Asserts.check(Asserts.java:34)
        at com.microsoft.applicationinsights.core.dependencies.http.pool.AbstractConnPool.lease(AbstractConnPool.java:189)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.conn.PoolingHttpClientConnectionManager.requestConnection(PoolingHttpClientConnectionManager.java:257)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.execchain.MainClientExec.execute(MainClientExec.java:176)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
        at com.microsoft.applicationinsights.core.dependencies.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
        at com.microsoft.applicationinsights.internal.channel.common.ApacheSender43.sendPostRequest(ApacheSender43.java:75)
        at com.microsoft.applicationinsights.internal.channel.common.TransmissionNetworkOutput.send(TransmissionNetworkOutput.java:185)
        at com.microsoft.applicationinsights.internal.channel.common.ActiveTransmissionNetworkOutput$1.run(ActiveTransmissionNetworkOutput.java:79)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

To Reproduce

  1. Create sample springboot app with a rest controller.
  2. Use ApplicationInsights Springboot starter to instrument the app.
  3. Add following properties to application.properties file:
    endpoints.shutdown.enabled=true
    management.security.enabled=false
  4. start the application with mvn spring-boot:run
  5. send post request to /shutdown endpoint.
@dhaval24
Copy link
Contributor Author

This is actually a open ended question!

@littleaj
Copy link
Contributor

I think I found a solution. Creating a PR.
Islandora/documentation#689

@ghost ghost locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants