[JAVA-1875] Generating new ObjectId() takes between 15 - 45 secs Created: 28/Jun/15  Updated: 28/Jun/15  Resolved: 28/Jun/15

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.13.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Valijon Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7, Eclipse Luna 4.4.2



 Description   

I am experimenting a bug with generating new ObjectId in my project.
The first invocation takes about 15 - 45 secs, but then (posterior invocations works as usual) everything is ok.
This happens only when I anchor my laptop to my smartphone to access Internet!

Seems like NetworkInterface.getNetworkInterfaces() takes too much time to retrieve network information for the first time
ObjectId.class
579 Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();

here is my code:
long init = System.currentTimeMillis();
new ObjectId();
LOG.info("ObjectId generated in " + (System.currentTimeMillis() - init) + " ms");

Please fix it



 Comments   
Comment by Jeffrey Yemin [ 28/Jun/15 ]

First, this has never been reported before, so it's likely something fairly specific to your situation. Second, in production environments where this matters most, it's unlikely that a server would be using a mobile phone's internet connection. And third, the ObjectId specification basically requires that the driver do something like this.

So I'm closing this works as designed.

Generated at Thu Feb 08 08:55:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.