Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2113

Instantiating an ObjectId stuck in InetAddress.getLocalhost

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal

      We are experiencing this in only one specific environment but not elsewhere.

      Execution halts here:

      MongoClient client = new MongoClient(
      					Arrays.asList(new ServerAddress("localhost", 27017), new ServerAddress("localhost", 27018),
      							new ServerAddress("localhost", 27019)),
      					MongoClientOptions.builder().connectionsPerHost(10).threadsAllowedToBlockForConnectionMultiplier(5)
      							.connectTimeout(5000).writeConcern(WriteConcern.NORMAL).build());
      

      Stacktrace:

      2016-01-22 22:20:02
      Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.0-b11 mixed mode):
      
      "Attach Listener" daemon prio=10 tid=0x00007fd25c001000 nid=0x2f5d runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      
      "Low Memory Detector" daemon prio=10 tid=0x00007fd28c08e800 nid=0x568 runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      
      "C2 CompilerThread1" daemon prio=10 tid=0x00007fd28c08c800 nid=0x567 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      
      "C2 CompilerThread0" daemon prio=10 tid=0x00007fd28c089800 nid=0x566 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      
      "Signal Dispatcher" daemon prio=10 tid=0x00007fd28c087800 nid=0x565 runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      
      "Finalizer" daemon prio=10 tid=0x00007fd28c06d800 nid=0x564 in Object.wait() [0x00007fd27b75f000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x00000007c1f61300> (a java.lang.ref.ReferenceQueue$Lock)
      	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      	- locked <0x00000007c1f61300> (a java.lang.ref.ReferenceQueue$Lock)
      	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      	at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
      
      "Reference Handler" daemon prio=10 tid=0x00007fd28c06b800 nid=0x563 in Object.wait() [0x00007fd27b860000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x00000007c1f611d8> (a java.lang.ref.Reference$Lock)
      	at java.lang.Object.wait(Object.java:485)
      	at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
      	- locked <0x00000007c1f611d8> (a java.lang.ref.Reference$Lock)
      
      "main" prio=10 tid=0x00007fd28c007000 nid=0x55d runnable [0x00007fd2905f3000]
         java.lang.Thread.State: RUNNABLE
      	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
      	at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
      	at java.net.InetAddress.getAddressFromNameService(Unknown Source)
      	at java.net.InetAddress.getLocalHost(Unknown Source)
      	at sun.management.VMManagementImpl.getVmId(Unknown Source)
      	at sun.management.RuntimeImpl.getName(Unknown Source)
      	at org.bson.types.ObjectId.<clinit>(ObjectId.java:568)
      	at com.mongodb.Bytes.<clinit>(Bytes.java:226)
      	at com.mongodb.Mongo.<clinit>(Mongo.java:76)
      	at com.til.ibeat.script.AggregateTagsSort.createConnection(AggregateTagsSort.java:68)
      	at com.til.ibeat.script.AggregateTagsSort.<init>(AggregateTagsSort.java:53)
      	at com.til.ibeat.script.AggregateTagsSort.main(AggregateTagsSort.java:691)
      
      "VM Thread" prio=10 tid=0x00007fd28c065000 nid=0x562 runnable 
      
      "GC task thread#0 (ParallelGC)" prio=10 tid=0x00007fd28c01a000 nid=0x55e runnable 
      
      "GC task thread#1 (ParallelGC)" prio=10 tid=0x00007fd28c01c000 nid=0x55f runnable 
      
      "GC task thread#2 (ParallelGC)" prio=10 tid=0x00007fd28c01d800 nid=0x560 runnable 
      
      "GC task thread#3 (ParallelGC)" prio=10 tid=0x00007fd28c01f800 nid=0x561 runnable 
      
      "VM Periodic Task Thread" prio=10 tid=0x00007fd28c099800 nid=0x569 waiting on condition 
      
      JNI global references: 983
      
      2016-02-04 10:28:48
      Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode):
       
      "Attach Listener" daemon prio=10 tid=0x00007f5268001000 nid=0x411d waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
       
         Locked ownable synchronizers:
      	- None
       
      "Low Memory Detector" daemon prio=10 tid=0x00007f529c095800 nid=0x3964 runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
       
         Locked ownable synchronizers:
      	- None
       
      "C2 CompilerThread1" daemon prio=10 tid=0x00007f529c093800 nid=0x3963 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
       
         Locked ownable synchronizers:
      	- None
       
      "C2 CompilerThread0" daemon prio=10 tid=0x00007f529c090800 nid=0x3962 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
       
         Locked ownable synchronizers:
      	- None
       
      "Signal Dispatcher" daemon prio=10 tid=0x00007f529c08e800 nid=0x3961 runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
       
         Locked ownable synchronizers:
      	- None
       
      "Finalizer" daemon prio=10 tid=0x00007f529c072000 nid=0x395b in Object.wait() [0x00007f52a067e000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x00000007ad161300> (a java.lang.ref.ReferenceQueue$Lock)
      	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      	- locked <0x00000007ad161300> (a java.lang.ref.ReferenceQueue$Lock)
      	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      	at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
       
         Locked ownable synchronizers:
      	- None
       
      "Reference Handler" daemon prio=10 tid=0x00007f529c070000 nid=0x395a in Object.wait() [0x00007f52a077f000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x00000007ad1611d8> (a java.lang.ref.Reference$Lock)
      	at java.lang.Object.wait(Object.java:485)
      	at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
      	- locked <0x00000007ad1611d8> (a java.lang.ref.Reference$Lock)
       
         Locked ownable synchronizers:
      	- None
       
      "main" prio=10 tid=0x00007f529c007800 nid=0x3946 runnable [0x00007f52a2f50000]
         java.lang.Thread.State: RUNNABLE
      	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
      	at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
      	at java.net.InetAddress.getAddressFromNameService(Unknown Source)
      	at java.net.InetAddress.getLocalHost(Unknown Source)
      	- locked <0x00000007ad5c1998> (a java.lang.Object)
      	at sun.management.VMManagementImpl.getVmId(Unknown Source)
      	at sun.management.RuntimeImpl.getName(Unknown Source)
      	at org.bson.types.ObjectId.createProcessIdentifier(ObjectId.java:506)
      	at org.bson.types.ObjectId.<clinit>(ObjectId.java:464)
      	at com.mongodb.connection.ClusterId.<init>(ClusterId.java:47)
      	at com.mongodb.connection.DefaultClusterFactory.create(DefaultClusterFactory.java:69)
      	at com.mongodb.Mongo.createCluster(Mongo.java:682)
      	at com.mongodb.Mongo.createCluster(Mongo.java:656)
      	at com.mongodb.Mongo.<init>(Mongo.java:285)
      	at com.mongodb.Mongo.<init>(Mongo.java:273)
      	at com.mongodb.MongoClient.<init>(MongoClient.java:238)
      	at com.til.ibeat.script.SocialGraphDataRef.createConnection(SocialGraphDataRef.java:51)
      	at com.til.ibeat.script.SocialGraphDataRef.<init>(SocialGraphDataRef.java:43)
      	at com.til.ibeat.script.SocialGraphDataRef.main(SocialGraphDataRef.java:99)
       
         Locked ownable synchronizers:
      	- None
       
      "VM Thread" prio=10 tid=0x00007f529c069800 nid=0x3957 runnable 
       
      "GC task thread#0 (ParallelGC)" prio=10 tid=0x00007f529c01a800 nid=0x394c runnable 
       
      "GC task thread#1 (ParallelGC)" prio=10 tid=0x00007f529c01c000 nid=0x394e runnable 
       
      "GC task thread#2 (ParallelGC)" prio=10 tid=0x00007f529c01e000 nid=0x394f runnable 
       
      "GC task thread#3 (ParallelGC)" prio=10 tid=0x00007f529c020000 nid=0x3950 runnable 
       
      "GC task thread#4 (ParallelGC)" prio=10 tid=0x00007f529c022000 nid=0x3951 runnable 
       
      "GC task thread#5 (ParallelGC)" prio=10 tid=0x00007f529c024000 nid=0x3952 runnable 
       
      "VM Periodic Task Thread" prio=10 tid=0x00007f529c0a8800 nid=0x3965 waiting on condition 
       
      JNI global references: 1034
      

      MongoDB version - 3.0.8
      Java Driver Version - 3.0.0

            Assignee:
            Unassigned Unassigned
            Reporter:
            ankit.kakkar@mongodb.com Ankit Kakkar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: