Interesting. I think your "# sync everything to the db" comment is misplaced, shouldn't that be up at the top of writer()?
In "except Exception as e" you should log the exception, traceback, item, and current queue contents, since you've arrived at a very bad place and you'll want all the debug info you can get.
Replacing the queue with a new one will work as long as no one is waiting for an event on the old queue. That should work ok in your code, in the Exception handler, since no one is waiting on the queue at that point.
I'm concerned that the queue is unbounded - what happens if Mongo is down / unavailable for a long time? The queue size could grow huge. Perhaps you should set a max_size on the queue, and update should do:
queue.put(
item,
callback=lambda x: logging.error("queue full, can't put %s" % item) if x is Full else None,
deadline=timedelta(seconds=10))
It all depends what you really want to do in error states. Pause until things get back to normal? Discard items?