Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-11885

ChannelPool can get in inconsistent state with concurrent release and close of a channel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 11.0.0.Final
    • 10.1.8.Final
    • Hot Rod
    • None

      While working on https://github.com/infinispan/infinispan/pull/8358 I found that the changes introduced allowed for a test failure to occur much more often. Upon investigation the issue is that the channel pool can close a channel and then release it which gets it in an inconsistent state.

      Looking closer it appears to be a bug in the ChannelPool class when a connection is closed before release completes.

      23:42:12,203 TRACE (DistributionRetryTest-Client-Async-1-2:[]) [ChannelPool] Closed channel [id: 0x27befd37, L:/127.0.0.1:37412 ! R:127.0.0.1/127.0.0.1:33943], created = 0, idle = false, active = 0
      23:42:12,203 TRACE (testng-DistributionRetryTest:[]) [ChannelPool] Released channel [id: 0x27befd37, L:/127.0.0.1:37412 ! R:127.0.0.1/127.0.0.1:33943], active = -1
      

      Here is the trace of it working where is is released before being closed.

      23:46:42,649 TRACE (testng-DistributionRetryTest:[]) [ChannelPool] Released channel [id: 0xeb9159ef, L:/127.0.0.1:39342 - R:127.0.0.1/127.0.0.1:41537], active = 0
      23:46:42,792 TRACE (testng-DistributionRetryTest:[]) [ChannelPool] Activated record [id: 0x0b71d548, L:/127.0.0.1:51392 - R:127.0.0.1/127.0.0.1:37881], created = 1, active = 1
      23:46:42,793 TRACE (DistributionRetryTest-Client-Async-1-3:[]) [ChannelPool] Closed channel [id: 0xeb9159ef, L:/127.0.0.1:39342 ! R:127.0.0.1/127.0.0.1:41537], created = 0, idle = true, active = 0
      

            wburns@redhat.com Will Burns
            wburns@redhat.com Will Burns
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: