-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.8
-
Component/s: Query Operations, Write Ops
-
None
Currently, when a pymongo.bulk._Bulk operation executes, it is marked as 'executed' before dispatching the actual command.
This means that if the command would fail with, say, an OperationalFailure - and would be manually retried by the users, an: InvalidOperation('Bulk operations can only be executed once.') exception will be raised.
If that was not the intentional behavior, I think we could either:
- Decide that it is, in fact, the desired behavior - and document it
- Mark the operation as executed only on successful invocations
- Mark the operation as executed on successful invocations, and on timeout errors, where we can't determine whether the operation had took place or not
Would love to hear your suggestions and thoughts.
Thanks !