michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
247 stars 199 forks source link

Updating data to trigger collection to mongodb sometimes fails #172

Closed xucong996 closed 4 years ago

xucong996 commented 5 years ago

we uesd custer mongodb, and all of collection in the db is sharded by _id, but the trigger collection created with unique inex(keyGroup_1_keyName_1), so we only created trigger collection not use shard. sometimes, we use storeTriggerAndJob(), jobDao will Working normally, but triggerDao will get a exception, : com.mongodb.MongoBulkWriteException : Bulk write operation error on server 12.10.13.15.16852. Write concern error : WriteConcernError{code=64. codeName='', message='waiting for replication timed out at shardll''}

michaelklishin commented 4 years ago

waiting for replication timed out at shardll

is the line you are looking for. This job store cannot avoid timeouts of MongoDB operations. Operation timeouts is a sad fact of distributed systems life. If you have specific suggestions as to what this job could do better to be more resilient, please submit a pull request.