Repository: apache/shardingsphere
Issue: Proxy blocked when client connect and close repeatly

For English only, other languages we will close it directly.

Please answer these questions before submitting your issue. Thanks!

### Which version of Sharding-Sphere do you using?
3.0.0.M3

### Which project do you using? Sharding-JDBC or Sharding-Proxy?
Sharding-Proxy

### Expected behavior
High Availability.

### Actual behavior
Proxy blocked when client connect and close repeatly.

### Reason analyze
Only when a client close the connection meanwhile a query is not finish in this connection will triger this bug.
When a frontend connection is closed the connection will become not writable, this cause MySQLFrontendHandler wait and never jump out the loop.
 
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc
Execute a slow SQL then close the connection until the connections is used up.

### For bug report, please *MUST* provide the reproduce example codes (such as a github link).
Official example.


Changed files:
sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/common/FrontendHandler.java
sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java

diff --git a/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java b/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java
index c55bbe06705..649a304923d 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java
@@ -98,7 +98,7 @@ public final class ShardingProxy {
     }
     
     private void groupsEpoll(final ServerBootstrap bootstrap) {
-        workerGroup = new EpollEventLoopGroup(RULE_REGISTRY.getAcceptorSize());
+        workerGroup = new EpollEventLoopGroup();
         userGroup = new EpollEventLoopGroup(RULE_REGISTRY.getAcceptorSize());
         bootstrap.group(bossGroup, workerGroup)
             .channel(EpollServerSocketChannel.class)
@@ -111,7 +111,7 @@ public final class ShardingProxy {
     }
     
     private void groupsNio(final ServerBootstrap bootstrap) {
-        workerGroup = new NioEventLoopGroup(RULE_REGISTRY.getAcceptorSize());
+        workerGroup = new NioEventLoopGroup();
         userGroup = new NioEventLoopGroup(RULE_REGISTRY.getAcceptorSize());
         bootstrap.group(bossGroup, workerGroup)
             .channel(NioServerSocketChannel.class)
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/common/FrontendHandler.java b/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/common/FrontendHandler.java
index d645a1fc986..8643d862010 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/common/FrontendHandler.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/common/FrontendHandler.java
@@ -34,7 +34,7 @@ public abstract class FrontendHandler extends ChannelInboundHandlerAdapter {
     private boolean authorized;
     
     @Setter
-    private BackendConnection backendConnection;
+    private volatile BackendConnection backendConnection;
     
     @Override
     public final void channelActive(final ChannelHandlerContext context) {