##// END OF EJS Templates
pull-requests: fix problem with long DB transaction and row-locking....
marcink -
r2785:d0af9af8 default
parent child Browse files
Show More
@@ -510,6 +510,7 b' class PullRequestModel(BaseModel):'
510 reviewer.rule_data = rule_data
510 reviewer.rule_data = rule_data
511
511
512 Session().add(reviewer)
512 Session().add(reviewer)
513 Session().flush()
513
514
514 # Set approval status to "Under Review" for all commits which are
515 # Set approval status to "Under Review" for all commits which are
515 # part of this pull request.
516 # part of this pull request.
@@ -519,7 +520,13 b' class PullRequestModel(BaseModel):'
519 user=created_by_user,
520 user=created_by_user,
520 pull_request=pull_request
521 pull_request=pull_request
521 )
522 )
523 # we commit early at this point. This has to do with a fact
524 # that before queries do some row-locking. And because of that
525 # we need to commit and finish transation before below validate call
526 # that for large repos could be long resulting in long row locks
527 Session().commit()
522
528
529 # prepare workspace, and run initial merge simulation
523 MergeCheck.validate(
530 MergeCheck.validate(
524 pull_request, user=created_by_user, translator=translator)
531 pull_request, user=created_by_user, translator=translator)
525
532
@@ -1629,7 +1636,7 b' class MergeCheck(object):'
1629 if fail_early:
1636 if fail_early:
1630 return merge_check
1637 return merge_check
1631
1638
1632 # merge possible
1639 # merge possible, here is the filesystem simulation + shadow repo
1633 merge_status, msg = PullRequestModel().merge_status(
1640 merge_status, msg = PullRequestModel().merge_status(
1634 pull_request, translator=translator,
1641 pull_request, translator=translator,
1635 force_shadow_repo_refresh=force_shadow_repo_refresh)
1642 force_shadow_repo_refresh=force_shadow_repo_refresh)
General Comments 0
You need to be logged in to leave comments. Login now