[JAVA-25] Add configuration option to Java driver to ignore say() errors (all writes) (WAS: disable throwing interrupted exception) Created: 26/Aug/09  Updated: 02/Oct/09  Resolved: 14/Sep/09

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

Type: Improvement Priority: Minor - P4
Reporter: Ryan Nitz Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Should make a config option at the Collection level that doesn't throw an exception if any write fails.

OLD------


When the driver is interrupted during a server read/write (via a server shutdown), it throws a MongException. Some people may care about this but others do not (like me ). It creates a lot of noise in my log files. I can catch all the exceptions and look at the cause but that would result in a lot of ugly code.

It would be handy if you could configure the Mongo object to not throw these.

can't say something
com.mongodb.MongoException$Network: can't say something
at com.mongodb.DBTCP.say(DBTCP.java:133)
at com.mongodb.DBMessageLayer.doUpdate(DBMessageLayer.java:42)
at com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:461)
at lindex.ds.PageDs.updateAttr(PageDs.java:147)
at lindex.telemeter.PageBacklinkCountSensor.execute(PageBacklinkCountSensor.java:123)
at oemware.core.MultiThread.run(MultiThread.java:164)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.nio.channels.ClosedByInterruptException
at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
at sun.nio.ch.SocketChannelImpl.write0(SocketChannelImpl.java:372)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:388)
at java.nio.channels.SocketChannel.write(SocketChannel.java:360)
at com.mongodb.DBPort.go(DBPort.java:79)
at com.mongodb.DBPort.say(DBPort.java:64)
at com.mongodb.DBTCP.say(DBTCP.java:127)
... 6 more



 Comments   
Comment by Eliot Horowitz (Inactive) [ 14/Sep/09 ]

coll.setWriteConcern( Mongo.WriteConcern.NONE)

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