Issue is closed multiple times

Summary

When I accept a merge request which closes an issue I see in the activity log the message <user name> closed issue #X two times.

Steps to reproduce

  • Create an issue
  • Create a branch for this issue
  • Create a merge request for this branch
  • Accept the merge request

Expected behavior

In the activity log I should see the message <user name> closed issue #X only once

Actual behavior

In the activity log I should see the message <user name> closed issue #X two times

Relevant logs and/or screenshots

gitlab_issue

Output of checks

This bug happens on my own instance of gitlab community edition version 8.16.3

Results of GitLab application Check

   Checking GitLab Shell ...

GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
2/1 ... ok
2/8 ... ok
1/9 ... ok
1/10 ... ok
1/12 ... ok
1/13 ... ok
16/20 ... ok
17/21 ... repository is empty
1/22 ... ok
1/23 ... ok
1/24 ... ok
1/25 ... ok
1/27 ... ok
1/28 ... ok
1/29 ... ok
22/31 ... ok
1/32 ... ok
1/33 ... ok
16/35 ... ok
17/37 ... ok
26/39 ... ok
1/41 ... ok
22/42 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... 
2/1 ... yes
2/8 ... yes
1/9 ... yes
1/10 ... yes
1/12 ... yes
1/13 ... yes
16/20 ... yes
17/21 ... yes
1/22 ... yes
1/23 ... yes
1/24 ... yes
1/25 ... yes
1/27 ... yes
1/28 ... yes
1/29 ... yes
22/31 ... yes
1/32 ... yes
1/33 ... yes
16/35 ... yes
17/37 ... yes
26/39 ... yes
1/41 ... yes
22/42 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.10.2)
Active users: 26

Checking GitLab ... Finished

Results of GitLab environment info

   
System information
System:		Ubuntu 14.04
Current User:	git
Using RVM:	no
Ruby Version:	2.3.3p222
Gem Version:	2.6.6
Bundler Version:1.13.7
Rake Version:	10.5.0
Sidekiq Version:4.2.7

GitLab information
Version:	8.16.3
Revision:	d225908
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	4.1.1
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:		/opt/gitlab/embedded/bin/git

I removed urls from the output