<p dir="auto">connect to the database <code class="notranslate">sharding_db</code>,which is a logical  postgresql database(use sharding-proxy for database-spliting). when I am using some database client-tools,such as navicat,pg_dump.</p>
<p dir="auto">It always complain that I don't specify client-encoding, even I indeed do it already:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="root@a15d5aac4a11:/var/lib/postgresql/data# pg_dump -E UTF8 -U postgres -d sharding_db -h 192.168.10.53 -p 13308 &gt; test.sql
pg_dump: [archiver (db)] connection to database &quot;sharding_db&quot; failed: ERROR:  Null charset name"><pre class="notranslate">root@a15d5aac4a11:/var/lib/postgresql/data# pg_dump -E UTF8 -U postgres -d sharding_db -h 192.168.10.53 -p 13308 <span class="pl-k">&gt;</span> test.sql
pg_dump: [archiver (db)] connection to database <span class="pl-s"><span class="pl-pds">"</span>sharding_db<span class="pl-pds">"</span></span> failed: ERROR:  Null charset name</pre></div>
<h2 dir="auto">Logs</h2>
<p dir="auto">I run sharding-proxy as a docker container, the logs digest as below:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[ERROR] 2021-12-07 10:07:12.535 [epollEventLoopGroup-3-7] o.a.s.p.f.n.FrontendChannelInboundHandler - Exception occur: 
java.lang.IllegalArgumentException: Null charset name
	at java.nio.charset.Charset.lookup(Charset.java:457)
	at java.nio.charset.Charset.forName(Charset.java:528)
	at org.apache.shardingsphere.proxy.frontend.postgresql.authentication.PostgreSQLAuthenticationEngine.processStartupMessage(PostgreSQLAuthenticationEngine.java:85)
	at org.apache.shardingsphere.proxy.frontend.postgresql.authentication.PostgreSQLAuthenticationEngine.authenticate(PostgreSQLAuthenticationEngine.java:78)
	at org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler.authenticate(FrontendChannelInboundHandler.java:80)
	at org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler.channelRead(FrontendChannelInboundHandler.java:72)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
"><pre class="notranslate">[ERROR] 2021-12-07 10:07:12.535 [epollEventLoopGroup-3-7] o.a.s.p.f.n.FrontendChannelInboundHandler - Exception occur: 
java.lang.IllegalArgumentException: Null charset name
	at java.nio.charset.Charset.lookup(Charset.java:457)
	at java.nio.charset.Charset.forName(Charset.java:528)
	at org.apache.shardingsphere.proxy.frontend.postgresql.authentication.PostgreSQLAuthenticationEngine.processStartupMessage(PostgreSQLAuthenticationEngine.java:85)
	at org.apache.shardingsphere.proxy.frontend.postgresql.authentication.PostgreSQLAuthenticationEngine.authenticate(PostgreSQLAuthenticationEngine.java:78)
	at org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler.authenticate(FrontendChannelInboundHandler.java:80)
	at org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler.channelRead(FrontendChannelInboundHandler.java:72)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline<span class="pl-smi">$HeadContext</span>.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.epoll.AbstractEpollStreamChannel<span class="pl-smi">$EpollStreamUnsafe</span>.epollInReady(AbstractEpollStreamChannel.java:795)
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
	at io.netty.util.concurrent.SingleThreadEventExecutor<span class="pl-smi">$4</span>.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap<span class="pl-smi">$2</span>.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
</pre></div>
<p dir="auto">There are 30 connections, two instances in total<br>
Problem Description:<br>
Multiple instances refresh the data source, reload the data source, and create a link. Before this process, first check the old data source and new data source, including fragment configuration; CLose new  and old data sources have interactive data source links ，Use new data source list<br>
Before refresh<br>
There are 60 connections</p>
<p dir="auto">After refresh<br>
There are 90 connections<br>
org.apache.shardingsphere.shardingjdbc.jdbc.adapter.AbstractDataSourceAdapter#close(java.util.Collection&lt;java.lang.String&gt;)<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/45254883/140731860-4bbe328c-3456-489a-9950-e2c47b2e8a36.png"><img src="https://user-images.githubusercontent.com/45254883/140731860-4bbe328c-3456-489a-9950-e2c47b2e8a36.png" alt="image" style="max-width: 100%;"></a><br>
Database link exception after closing</p>