Q:

mongodb allanbank async driver durability timeout

Does anyone happen to know what the waitTimeoutMillis in the Durability constructor argument actually does in the allanbank async driver (or the 10gen driver for that matter)?
If I set a timeout of 0 will it wait forever?
If I set a very low timeout (e.g. 1) and the timeout is triggered will it cancel the transaction or just throw an exception and return before the transaction completes?

A:

The timeout is handled at the server as part of the getLastError command (or GLE).
See http://docs.mongodb.org/manual/reference/command/getLastError/#dbcmd.getLastError :

wtimeout (integer) – Optional. Milliseconds. Specify a value in milliseconds to control how long to wait for write propagation to complete. If replication does not complete in the given timeframe, the getLastError command will return with an error status.

Based on the 10gen driver Javadoc believe a waitTimeout of zero blocks forever but I would have to test it to verify.
HTH - Rob.

