Race condition when issue is closed by merge commit and merge request
### Summary When a merge request contains "Closes #43533433" and the merge request commit for this merge request contains "Closes #43533433" it is possible that we will execute `Issues::CloseService` twice. This results in duplicate system notes being added to the issue and duplicate emails being sent. ### Steps to reproduce 1. Create an issue 2. Create a merge request that closes the issue 3. Merge the merge request preserving "Closes" phrase in the merge commit message It's a race condition so you may have to repeat it multiple times to see it. ### Relevant logs and/or screenshots ![Screen_Shot_2016-11-30_at_12.12.05](/uploads/bf5d883915304f3a096a647632dd800c/Screen_Shot_2016-11-30_at_12.12.05.png)
issue