Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13719

Thin client silently closes channel after inactivity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9
    • 2.10, 2.9.1
    • None
    • None
    • Java thin: fix unexpected channel close due to inactivity
    • Docs Required, Release Notes Required

    Description

      The following code works fine with ignite-core 2.8.0, but fails with 2.9.0 (see the exception below). It looks like timeout is applied to client receiver thread. When it's not used for a while it gets closed silently. 

      public class IgniteDemo
      {
          public static final int TIMEOUT = 1000;
      
          public static void main(String[] args) throws InterruptedException
          {
              new IgniteDemo().run();
          }
      
          public void run() throws InterruptedException
          {
              final Ignite igniteServer = Ignition.start();
      
              final ClientConfiguration cfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");
              cfg.setTimeout(TIMEOUT);
              final IgniteClient igniteClient = Ignition.startClient(cfg);
              final ClientCache<Object, Object> cache = igniteClient.getOrCreateCache("test");
      
              Thread.sleep(TIMEOUT);
              cache.put(1, 1);
      
              Thread.sleep(TIMEOUT);
              cache.put(2, 2);
          }
      }
      
      
       
      Exception in thread "main" org.apache.ignite.client.ClientConnectionException: Channel is closedException in thread "main" org.apache.ignite.client.ClientConnectionException: Channel is closed at org.apache.ignite.internal.client.thin.TcpClientChannel.send(TcpClientChannel.java:236) at org.apache.ignite.internal.client.thin.TcpClientChannel.service(TcpClientChannel.java:217) at org.apache.ignite.internal.client.thin.ReliableChannel.service(ReliableChannel.java:198) at org.apache.ignite.internal.client.thin.ReliableChannel.affinityService(ReliableChannel.java:261) at org.apache.ignite.internal.client.thin.TcpClientCache.cacheSingleKeyOperation(TcpClientCache.java:508) at org.apache.ignite.internal.client.thin.TcpClientCache.put(TcpClientCache.java:127) at IgniteDemo.run(IgniteDemo.java:26) at IgniteDemo.main(IgniteDemo.java:13)
      

      Attachments

        Issue Links

          Activity

            People

              alex_pl Aleksey Plekhanov
              jifwin jifwin
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h