##// END OF EJS Templates
pull-requests: fix problem with long DB transaction and row-locking....
marcink -
r2792:d618fd27 stable
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
@@ -1624,7 +1631,7 b' class MergeCheck(object):'
1624 if fail_early:
1631 if fail_early:
1625 return merge_check
1632 return merge_check
1626
1633
1627 # merge possible
1634 # merge possible, here is the filesystem simulation + shadow repo
1628 merge_status, msg = PullRequestModel().merge_status(
1635 merge_status, msg = PullRequestModel().merge_status(
1629 pull_request, translator=translator)
1636 pull_request, translator=translator)
1630 merge_check.merge_possible = merge_status
1637 merge_check.merge_possible = merge_status
General Comments 0
You need to be logged in to leave comments. Login now