Comment 6 for bug 615654

Revision history for this message
Curtis Hovey (sinzui) wrote :

We are calling Person.setMembershipData() for each Person.proposedmembers to Approve or Decline. That in turn calls TeamMembership.setStatus() for each update. This method calls flush_database_updates() to ensure the data is pushed back the db, then self._sendStatusChangeNotification() is called.

The email operations, represented by the repeated email address lookups is difficult problem. I noted earlier today that since there is not event/subscribe mechanism for membership status changes, mailing-list-auto-subscriptions are broken in 3 use cases, this use case is broken after sending a some number of emails. We really want to decouple sending the notification from the approve/decline event, or queue a job.

I think we could get all the proposedmembers *and* their memberships is a single call, but in this case we would be dealing with 35 of the 398 queries (17 memberships were not reached at the time of timeout).

We could revise the TeamMembershipSet to do batch changes. In this use case, we want to make two calls to the TeamMembershipSet to change the status of a list of users to approves or declined and pass the reviewer and his message in. If the email is still sent in proc, we need al bulk email sender for each batch call.