Ecwid / consul-api

Java client for Consul HTTP API
Apache License 2.0
416 stars 177 forks source link

consulRawClient ```java.lang.IllegalStateException: Connection pool shut down``` #230

Open FangXiaoMing2021 opened 2 years ago

FangXiaoMing2021 commented 2 years ago

I encountered this error using the consul client, I don’t know how it happened, can anyone help?

java.lang.IllegalStateException: Connection pool shut down
FangXiaoMing2021 commented 2 years ago
consul-api version 1.4.1
httpclient version 4.5.10
httpcore version 4.4.11
Kunple-w commented 1 year ago

i got same exception, it seems to be caused by httpcomponents. in httpcomponents 4.5.x, developer push this code #https://github.com/apache/httpcomponents-client/commit/ca98ad69adad79de57d8b944ba524f7267a795cb,

        } catch (final RuntimeException ex) {
            releaseTrigger.abortConnection();
            throw ex;
        } catch (final Error error) {
            connManager.shutdown();
            throw error;
        }
    }

if your app throw StackOverflowErroror OutOfMemoryError or else Error, may be catched by this code,then connection pool shutdown.