[ 
https://issues.apache.org/jira/browse/IGNITE-17554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stepanov Ilya updated IGNITE-17554:
-----------------------------------
    Description: 
Metrics "\{clientType}.ActiveSessions" are not updated correctly in case of 
connection problems.

 

Steps to reproduce: 

1) Start server
2) Start jdbc or thin client
3) On the server host block 10800 port
{code:java}
iptables -A INPUT -p tcp --dport 10800 -j DROP {code}
4) Check "\{clientType}.ActiveSessions". We will see one connection. 
5) Stop jdbc or thin client 
6) Check "\{clientType}.ActiveSessions". We will still see one connection in 
"\{clientType}.ActiveSessions".
7) After about 2 hours, the metric will have a negative value = -1

Error in log:
{code:java}
[ERROR][grid-nio-worker-client-listener-1-#55][ClientListenerProcessor] Failed 
to process selector key [ses=GridSelectorNioSessionImpl [worker=DirectNioClient
Worker [super=AbstractNioClientWorker [idx=1, bytesRcvd=19, bytesSent=28, 
bytesRcvd0=0, bytesSent0=0, select=true, super=GridWorker 
[name=grid-nio-worker-client-listener-1, igniteInst
anceName=null, finished=false, heartbeatTs=1661784642354, hashCode=624626958, 
interrupted=false, runner=grid-nio-worker-client-listener-1-#55]]], 
writeBuf=java.nio.DirectByteBuffer[po
s=0 lim=23040 cap=23040], readBuf=java.nio.DirectByteBuffer[pos=0 lim=184640 
cap=184640], inRecovery=null, outRecovery=null, closeSocket=true, 
outboundMessagesQueueSizeMetric=o.a.i.i.
processors.metric.impl.LongAdderMetric@63a61cb2, super=GridNioSessionImpl 
[locAddr=/10.40.6.205:10800, rmtAddr=/10.255.12.2:4708, 
createTime=1661776500783, closeTime=0, bytesSent=28, 
bytesRcvd=19, bytesSent0=0, bytesRcvd0=0, sndSchedTime=1661776500844, 
lastSndTime=1661776500844, lastRcvTime=1661776500833, readsPaused=false, 
filterChain=FilterChain[filters=[GridNio
AsyncNotifyFilter, GridNioCodecFilter [parser=ClientListenerNioMessageParser, 
directMode=true]], accepted=true, markedForClose=false]]]
java.io.IOException: Connection timed out
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:1.8.0_302]
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) 
~[?:1.8.0_302]
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) 
~[?:1.8.0_302]
        at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_302]
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) 
~[?:1.8.0_302]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$DirectNioClientWorker.processRead(GridNioServer.java:1351)
 ~[ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.processSelectedKeysOptimized(GridNioServer.java:2508)
 [ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.bodyInternal(GridNioServer.java:2273)
 [ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.body(GridNioServer.java:1910)
 [ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:125) 
[ignite-core-2.13.1-p0.jar:2.13.1-p0] {code}
 

Another case with proxy:

 

Steps to reproduce: 
1) Start server 
2) Start Proxy server for remote port 10800 and local port 1024
3) Start jdbc or thin client with connecting to proxy server
{code:java}
ClientConfiguration cfg = new 
ClientConfiguration().setAddresses("127.0.0.1:1024");
IgniteClient igniteClient = Ignition.startClient(cfg);
IgniteClient igniteClient2 = Ignition.startClient(cfg); {code}
4) Check "\{clientType}.ActiveSessions" and "views.CLIENT_CONNECTIONS". We will 
see one connection. 
5) Stop jdbc or thin client 
6) Stop Proxy server 
7) Check "\{clientType}.ActiveSessions" and "views.CLIENT_CONNECTIONS".

We will still see one connection in "\{clientType}.ActiveSessions" and no 
connection in "views.CLIENT_CONNECTIONS".

  was:
"\{clientType}.ActiveSessions" metrics no correctly updated in case when we 
have a problems with connection.

 

Steps to reproduce: 

1) Start server
2) Start jdbc or thin client
3) On the server host block 10800 port
{code:java}
iptables -A INPUT -p tcp --dport 10800 -j DROP {code}
4) Check "\{clientType}.ActiveSessions". We will see one connection. 
5) Stop jdbc or thin client 
6) Check "\{clientType}.ActiveSessions". We will still see one connection in 
"\{clientType}.ActiveSessions".
7) After about 2 hours, the metric will have a negative value = -1

Error in log:
{code:java}
[ERROR][grid-nio-worker-client-listener-1-#55][ClientListenerProcessor] Failed 
to process selector key [ses=GridSelectorNioSessionImpl [worker=DirectNioClient
Worker [super=AbstractNioClientWorker [idx=1, bytesRcvd=19, bytesSent=28, 
bytesRcvd0=0, bytesSent0=0, select=true, super=GridWorker 
[name=grid-nio-worker-client-listener-1, igniteInst
anceName=null, finished=false, heartbeatTs=1661784642354, hashCode=624626958, 
interrupted=false, runner=grid-nio-worker-client-listener-1-#55]]], 
writeBuf=java.nio.DirectByteBuffer[po
s=0 lim=23040 cap=23040], readBuf=java.nio.DirectByteBuffer[pos=0 lim=184640 
cap=184640], inRecovery=null, outRecovery=null, closeSocket=true, 
outboundMessagesQueueSizeMetric=o.a.i.i.
processors.metric.impl.LongAdderMetric@63a61cb2, super=GridNioSessionImpl 
[locAddr=/10.40.6.205:10800, rmtAddr=/10.255.12.2:4708, 
createTime=1661776500783, closeTime=0, bytesSent=28, 
bytesRcvd=19, bytesSent0=0, bytesRcvd0=0, sndSchedTime=1661776500844, 
lastSndTime=1661776500844, lastRcvTime=1661776500833, readsPaused=false, 
filterChain=FilterChain[filters=[GridNio
AsyncNotifyFilter, GridNioCodecFilter [parser=ClientListenerNioMessageParser, 
directMode=true]], accepted=true, markedForClose=false]]]
java.io.IOException: Connection timed out
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:1.8.0_302]
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) 
~[?:1.8.0_302]
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) 
~[?:1.8.0_302]
        at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_302]
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) 
~[?:1.8.0_302]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$DirectNioClientWorker.processRead(GridNioServer.java:1351)
 ~[ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.processSelectedKeysOptimized(GridNioServer.java:2508)
 [ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.bodyInternal(GridNioServer.java:2273)
 [ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.body(GridNioServer.java:1910)
 [ignite-core-2.13.1-p0.jar:2.13.1-p0]
        at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:125) 
[ignite-core-2.13.1-p0.jar:2.13.1-p0] {code}
 

Another case with proxy:

 

Steps to reproduce: 
1) Start server 
2) Start Proxy server for remote port 10800 and local port 1024
3) Start jdbc or thin client with connecting to proxy server
{code:java}
ClientConfiguration cfg = new 
ClientConfiguration().setAddresses("127.0.0.1:1024");
IgniteClient igniteClient = Ignition.startClient(cfg);
IgniteClient igniteClient2 = Ignition.startClient(cfg); {code}
4) Check "\{clientType}.ActiveSessions" and "views.CLIENT_CONNECTIONS". We will 
see one connection. 
5) Stop jdbc or thin client 
6) Stop Proxy server 
7) Check "\{clientType}.ActiveSessions" and "views.CLIENT_CONNECTIONS".

We will still see one connection in "\{clientType}.ActiveSessions" and no 
connection in "views.CLIENT_CONNECTIONS".


> {clientType}.ActiveSessions metrics are no updated in case of connection 
> problems/lost
> --------------------------------------------------------------------------------------
>
>                 Key: IGNITE-17554
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17554
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.13
>            Reporter: Stepanov Ilya
>            Priority: Minor
>              Labels: ise
>         Attachments: ProxyServer.java
>
>
> Metrics "\{clientType}.ActiveSessions" are not updated correctly in case of 
> connection problems.
>  
> Steps to reproduce: 
> 1) Start server
> 2) Start jdbc or thin client
> 3) On the server host block 10800 port
> {code:java}
> iptables -A INPUT -p tcp --dport 10800 -j DROP {code}
> 4) Check "\{clientType}.ActiveSessions". We will see one connection. 
> 5) Stop jdbc or thin client 
> 6) Check "\{clientType}.ActiveSessions". We will still see one connection in 
> "\{clientType}.ActiveSessions".
> 7) After about 2 hours, the metric will have a negative value = -1
> Error in log:
> {code:java}
> [ERROR][grid-nio-worker-client-listener-1-#55][ClientListenerProcessor] 
> Failed to process selector key [ses=GridSelectorNioSessionImpl 
> [worker=DirectNioClient
> Worker [super=AbstractNioClientWorker [idx=1, bytesRcvd=19, bytesSent=28, 
> bytesRcvd0=0, bytesSent0=0, select=true, super=GridWorker 
> [name=grid-nio-worker-client-listener-1, igniteInst
> anceName=null, finished=false, heartbeatTs=1661784642354, hashCode=624626958, 
> interrupted=false, runner=grid-nio-worker-client-listener-1-#55]]], 
> writeBuf=java.nio.DirectByteBuffer[po
> s=0 lim=23040 cap=23040], readBuf=java.nio.DirectByteBuffer[pos=0 lim=184640 
> cap=184640], inRecovery=null, outRecovery=null, closeSocket=true, 
> outboundMessagesQueueSizeMetric=o.a.i.i.
> processors.metric.impl.LongAdderMetric@63a61cb2, super=GridNioSessionImpl 
> [locAddr=/10.40.6.205:10800, rmtAddr=/10.255.12.2:4708, 
> createTime=1661776500783, closeTime=0, bytesSent=28, 
> bytesRcvd=19, bytesSent0=0, bytesRcvd0=0, sndSchedTime=1661776500844, 
> lastSndTime=1661776500844, lastRcvTime=1661776500833, readsPaused=false, 
> filterChain=FilterChain[filters=[GridNio
> AsyncNotifyFilter, GridNioCodecFilter [parser=ClientListenerNioMessageParser, 
> directMode=true]], accepted=true, markedForClose=false]]]
> java.io.IOException: Connection timed out
>         at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:1.8.0_302]
>         at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) 
> ~[?:1.8.0_302]
>         at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) 
> ~[?:1.8.0_302]
>         at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_302]
>         at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) 
> ~[?:1.8.0_302]
>         at 
> org.apache.ignite.internal.util.nio.GridNioServer$DirectNioClientWorker.processRead(GridNioServer.java:1351)
>  ~[ignite-core-2.13.1-p0.jar:2.13.1-p0]
>         at 
> org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.processSelectedKeysOptimized(GridNioServer.java:2508)
>  [ignite-core-2.13.1-p0.jar:2.13.1-p0]
>         at 
> org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.bodyInternal(GridNioServer.java:2273)
>  [ignite-core-2.13.1-p0.jar:2.13.1-p0]
>         at 
> org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.body(GridNioServer.java:1910)
>  [ignite-core-2.13.1-p0.jar:2.13.1-p0]
>         at 
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:125) 
> [ignite-core-2.13.1-p0.jar:2.13.1-p0] {code}
>  
> Another case with proxy:
>  
> Steps to reproduce: 
> 1) Start server 
> 2) Start Proxy server for remote port 10800 and local port 1024
> 3) Start jdbc or thin client with connecting to proxy server
> {code:java}
> ClientConfiguration cfg = new 
> ClientConfiguration().setAddresses("127.0.0.1:1024");
> IgniteClient igniteClient = Ignition.startClient(cfg);
> IgniteClient igniteClient2 = Ignition.startClient(cfg); {code}
> 4) Check "\{clientType}.ActiveSessions" and "views.CLIENT_CONNECTIONS". We 
> will see one connection. 
> 5) Stop jdbc or thin client 
> 6) Stop Proxy server 
> 7) Check "\{clientType}.ActiveSessions" and "views.CLIENT_CONNECTIONS".
> We will still see one connection in "\{clientType}.ActiveSessions" and no 
> connection in "views.CLIENT_CONNECTIONS".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to