Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22780

Uncaught error can lead to invalid WorkManager metrics

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.2
    • Fix Version/s: 9.3
    • Component/s: Events / Works

      Description

      For instance the error below will let a job at the running state in the metrics :

      getall nuxeo:work:count:default
      1) "nuxeo:work:sched:default"
      2) "0"
      3) "nuxeo:work:run:default"
      4) "1"
      5) "nuxeo:work:done:default"
      6) "247861"
      7) "nuxeo:work:cancel:default"
      8) "0"

      This cause code that use WorkManager#awaitForCompletion to wait until it times out, this is very annoying on the benchmark reference where we measure async jobs execution.

      2017-07-18 07:17:10,879 ERROR [Nuxeo-Work-default-2] [org.nuxeo.ecm.core.work.WorkManagerImpl] Uncaught error on thread Nuxeo-Work-default-2
      com.mongodb.MongoSocketOpenException: Exception opening socket
              at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
              at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
              at com.mongodb.connection.UsageTrackingInternalConnection.open(UsageTrackingInternalConnection.java:49)
              at com.mongodb.connection.DefaultConnectionPool$PooledConnection.open(DefaultConnectionPool.java:384)
              at com.mongodb.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:101)
              at com.mongodb.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:87)
              at com.mongodb.connection.DefaultServer.getConnection(DefaultServer.java:86)
              at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.getConnection(ClusterBinding.java:86)
              at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:239)
              at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:214)
              at com.mongodb.operation.FindOperation.execute(FindOperation.java:483)
              at com.mongodb.operation.FindOperation.execute(FindOperation.java:80)
              at com.mongodb.Mongo.execute(Mongo.java:818)
              at com.mongodb.Mongo$2.execute(Mongo.java:805)
              at com.mongodb.OperationIterable.iterator(OperationIterable.java:47)
              at com.mongodb.FindIterableImpl.iterator(FindIterableImpl.java:143)
              at com.mongodb.FindIterableImpl.iterator(FindIterableImpl.java:36)
              at java.lang.Iterable.spliterator(Iterable.java:101)
              at org.nuxeo.directory.mongodb.MongoDBReference.getIdsFor(MongoDBReference.java:220)
              at org.nuxeo.directory.mongodb.MongoDBReference.getSourceIdsForTarget(MongoDBReference.java:213)
              at org.nuxeo.ecm.directory.InverseReference.getTargetIdsForSource(InverseReference.java:153)
              at org.nuxeo.directory.mongodb.MongoDBSession.query(MongoDBSession.java:245)
              at org.nuxeo.directory.mongodb.MongoDBSession.query(MongoDBSession.java:206)
              at org.nuxeo.ecm.directory.BaseSession.getEntryFromSource(BaseSession.java:349)
              at org.nuxeo.ecm.directory.DirectoryCache.getEntry(DirectoryCache.java:121)
              at org.nuxeo.ecm.directory.BaseSession.getEntry(BaseSession.java:334)
              at org.nuxeo.ecm.directory.BaseSession.getEntry(BaseSession.java:322)
              at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getUserModel(UserManagerImpl.java:1129)
              at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getPrincipal(UserManagerImpl.java:1164)
              at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getPrincipalUsingCache(UserManagerImpl.java:582)
              at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getPrincipal(UserManagerImpl.java:574)
              at org.nuxeo.ecm.platform.usermanager.NuxeoPrincipalImpl$TransferableClone$DataTransferObject.readResolve(NuxeoPrincipalImpl.java:488)
              at sun.reflect.GeneratedMethodAccessor230.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1148)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1810)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at java.util.ArrayList.readObject(ArrayList.java:791)
              at sun.reflect.GeneratedMethodAccessor215.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1900)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at org.nuxeo.ecm.core.redis.contribs.RedisWorkQueuing.deserializeWork(RedisWorkQueuing.java:463)
              at org.nuxeo.ecm.core.redis.contribs.RedisWorkQueuing.getWorkFromQueue(RedisWorkQueuing.java:781)
              at org.nuxeo.ecm.core.redis.contribs.RedisBlockingQueue.pollElement(RedisBlockingQueue.java:143)
              at org.nuxeo.ecm.core.work.NuxeoBlockingQueue.poll(NuxeoBlockingQueue.java:121)
              at org.nuxeo.ecm.core.redis.contribs.RedisBlockingQueue.poll(RedisBlockingQueue.java:101)
              at org.nuxeo.ecm.core.redis.contribs.RedisBlockingQueue.take(RedisBlockingQueue.java:85)
              at org.nuxeo.ecm.core.redis.contribs.RedisBlockingQueue.take(RedisBlockingQueue.java:47)
              at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.net.ConnectException: Cannot assign requested address
              at java.net.PlainSocketImpl.socketConnect(Native Method)
              at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
              at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
              at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
              at java.net.Socket.connect(Socket.java:589)
              at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:50)
              at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
              ... 78 more
      
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h