Skip to content

Commit

Permalink
Revert "Get rollback inconsistencies using multiple processes (#3778)" (
Browse files Browse the repository at this point in the history
#3803)

This reverts commit 3ddaf41.
  • Loading branch information
marco-c authored Nov 9, 2023
1 parent 1abf12e commit 648ac3d
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions bugbug/bug_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.

from logging import INFO, basicConfig, getLogger
from multiprocessing.pool import Pool

import dateutil.parser
from dateutil.relativedelta import relativedelta
Expand Down Expand Up @@ -869,21 +868,17 @@ def parse_flag_change(change):
return bug


def _try_rollback(bug):
try:
return rollback(bug, do_assert=True), True
except Exception:
logger.exception("Failed to rollback bug %s", bug["id"])
return bug, False
def get_inconsistencies(bugs):
inconsistencies = []

for bug in bugs:
try:
rollback(bug, do_assert=True)
except Exception:
logger.exception("Failed to rollback bug %s", bug["id"])
inconsistencies.append(bug)

def get_inconsistencies(bugs):
with Pool() as p:
return [
bug
for bug, is_successful in p.imap(_try_rollback, bugs, chunksize=1024)
if not is_successful
]
return inconsistencies


if __name__ == "__main__":
Expand Down

0 comments on commit 648ac3d

Please sign in to comment.