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

ArithmeticException: / by zero in ClusterPublisherManagerImpl

    XMLWordPrintable

    Details

      Description

      Sometimes targets is empty (possible in scattered caches because segments can have 0 owners for a short time) and localSegments is null, making concurrentPublishers 0.

      This causes random failures in ScatteredStreamIteratorTest.verifyNodeLeavesBeforeGettingData[SCATTERED_SYNC, tx=false]

      java.util.concurrent.ExecutionException: org.infinispan.commons.CacheException: java.lang.ArithmeticException: / by zero
      	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
      	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
      	at org.infinispan.stream.DistributedStreamIteratorTest.verifyNodeLeavesBeforeGettingData(DistributedStreamIteratorTest.java:151)
      Caused by: org.infinispan.commons.CacheException: java.lang.ArithmeticException: / by zero
      	at org.infinispan.commons.util.Util.rewrapAsCacheException(Util.java:686)
      	at org.infinispan.commons.reactive.RxJavaInterop.lambda$static$2(RxJavaInterop.java:47)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableOnErrorNext$OnErrorNextSubscriber.onError(FlowableOnErrorNext.java:94)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableRepeatUntil$RepeatSubscriber.onError(FlowableRepeatUntil.java:72)
      	at io.reactivex.rxjava3.internal.subscriptions.EmptySubscription.error(EmptySubscription.java:55)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableScalarXMap$ScalarXMapFlowable.subscribeActual(FlowableScalarXMap.java:140)
      	at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15750)
      	at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15696)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableRepeatUntil$RepeatSubscriber.subscribeNext(FlowableRepeatUntil.java:109)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableRepeatUntil$RepeatSubscriber.onComplete(FlowableRepeatUntil.java:88)
      	at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:92)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.drainLoop(FlowableFlatMap.java:410)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.drain(FlowableFlatMap.java:358)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableFlatMap$InnerSubscriber.onComplete(FlowableFlatMap.java:643)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableDoOnLifecycle$SubscriptionLambdaSubscriber.onComplete(FlowableDoOnLifecycle.java:94)
      	at io.reactivex.rxjava3.processors.UnicastProcessor.checkTerminated(UnicastProcessor.java:417)
      	at io.reactivex.rxjava3.processors.UnicastProcessor.drainRegular(UnicastProcessor.java:301)
      	at io.reactivex.rxjava3.processors.UnicastProcessor.drain(UnicastProcessor.java:384)
      	at io.reactivex.rxjava3.processors.UnicastProcessor.onComplete(UnicastProcessor.java:474)
      	at org.infinispan.reactive.publisher.impl.InnerPublisherSubscription.accept(InnerPublisherSubscription.java:120)
      	at org.infinispan.reactive.publisher.impl.InnerPublisherSubscription.handleThrowableInResponse(InnerPublisherSubscription.java:245)
      	at org.infinispan.reactive.publisher.impl.InnerPublisherSubscription.lambda$accept$0(InnerPublisherSubscription.java:140)
      	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
      	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
      	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
      	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
      	at org.infinispan.remoting.transport.AbstractRequest.completeExceptionally(AbstractRequest.java:74)
      	at org.infinispan.remoting.transport.impl.SingleTargetRequest.onNewView(SingleTargetRequest.java:66)
      	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$receiveClusterView$3(JGroupsTransport.java:752)
      	at org.infinispan.remoting.transport.impl.RequestRepository.lambda$forEach$0(RequestRepository.java:59)
      	at java.base/java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603)
      	at org.infinispan.remoting.transport.impl.RequestRepository.forEach(RequestRepository.java:59)
      	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$receiveClusterView$4(JGroupsTransport.java:752)
      	... 3 more
      Caused by: java.lang.ArithmeticException: / by zero
      	at org.infinispan.reactive.publisher.impl.ClusterPublisherManagerImpl$SubscriberHandler.lambda$start$1(ClusterPublisherManagerImpl.java:927)
      	at io.reactivex.rxjava3.internal.operators.flowable.FlowableScalarXMap$ScalarXMapFlowable.subscribeActual(FlowableScalarXMap.java:137)
      	... 30 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dan.berindei Dan Berindei
              Reporter:
              dan.berindei Dan Berindei
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: