Fix activity retry settings for erp5_interface_post emails
In production, the sending of emails by using Internet Message Posts created activity failures : ``` Node: activities-XX Failures: 1 User name: 'System Processes' Uid: 1234567890 Document: /erp5/person_module/XXXX Method: Entity_sendEmail Arguments: () Named Parameters: {'cc_url': None, 'from_url': None, 'event_relative_url': 'event_module/YYYY'} Exception: Module Products.CMFActivity.Activity.SQLBase, line 607, in dequeueMessage transaction.commit() Module transaction._manager, line 123, in commit return self.get().commit() Module transaction._transaction, line 280, in commit reraise(t, v, tb) Module transaction._transaction, line 271, in commit self._commitResources() Module Products.TIDStorage.transaction_transaction, line 261, in _commitResources result = original__commitResources(self, *args, **kw) Module transaction._transaction, line 416, in _commitResources reraise(t, v, tb) Module transaction._transaction, line 393, in _commitResources rm.tpc_vote(self) Module ZODB.Connection, line 797, in tpc_vote s = vote(transaction) Module ZEO.ClientStorage, line 1072, in tpc_vote return self._check_serials() Module ZEO.ClientStorage, line 902, in _check_serials raise s ReadConflictError: database read conflict error (oid 0x12345 serial this txn started with 0x12345 2018-05-16 06:27:17.471887, serial currently committed 0x12345 2018-05-16 06:53:10.977183) ``` This Merge Request proposes to allow Entity_sendEmail to be retried in case of ConflictError, as now Entity_sendEmail is doing more than what it used to be. For this, we need to isolate the call to sendMailHostMessage to make sur that email won't be sent several times if the activity "Entity_sendEmail" is retried. We also make sure that the activity created to send a message through MailHost gets the correct parameters to be never retried (retry_max=0 and retry_conflict=False) /reviewed-on !672
Showing
Please register or sign in to comment