Comment 4 for bug 740478

Revision history for this message
Dmitry Chestnykh (dmitry-codingrobots) wrote :

Agree, will fix. BTW, should I put something like:

// Calling this function with an invalid id will cause a runtime panic.

into doc above every function?

>Btw, were you able to correlate the returned data with an actual pid? I've tried doing that with my local mongo, but it didn't really match.

Python driver puts "os.getpid() % 0xFFFF" into this field, while Mongo's logic is more complex: https://github.com/mongodb/mongo/blob/master/bson/oid.cpp

While documentation says "This is 2 bytes of the process id (or thread id) of the process generating the object id.", it's not what they actually do, so it may not correlate with the process id of mongod. Maybe change the doc string for Pid method to state "unique identifier of the process that generated id" to avoid confusion?