Stopping runnig GitLab container is causing Sidekiq exception
When stopping docker container exception is raised in Sidekiq:
==> /var/log/gitlab/redis/current <==
2016-09-23_11:45:55.17326 437:signal-handler (1474631155) Received SIGTERM scheduling shutdown...
2016-09-23_11:45:55.24448 437:M 23 Sep 11:45:55.244 # User requested shutdown...
2016-09-23_11:45:55.24450 437:M 23 Sep 11:45:55.244 * Saving the final RDB snapshot before exiting.
2016-09-23_11:45:55.25088 437:M 23 Sep 11:45:55.250 * DB saved on disk
2016-09-23_11:45:55.25089 437:M 23 Sep 11:45:55.250 * Removing the pid file.
2016-09-23_11:45:55.25089 437:M 23 Sep 11:45:55.250 * Removing the unix socket file.
2016-09-23_11:45:55.25091 437:M 23 Sep 11:45:55.250 # Redis is now ready to exit, bye bye...
==> /var/log/gitlab/sidekiq/current <==
2016-09-23_11:45:55.25176 2016-09-23T11:45:55.251Z 640 TID-zule0 ERROR: Error fetching job: No such file or directory - connect(2) for /var/opt/gitlab/redis/redis.socket
2016-09-23_11:45:55.25541 2016-09-23T11:45:55.252Z 640 TID-zw2ew ERROR: Error fetching job: No such file or directory - connect(2) for /var/opt/gitlab/redis/redis.socket
2016-09-23_11:45:55.25634 2016-09-23T11:45:55.252Z 640 TID-zulyk ERROR: Error fetching job: No such file or directory - connect(2) for /var/opt/gitlab/redis/redis.socket
2016-09-23_11:45:55.25644 2016-09-23T11:45:55.252Z 640 TID-zule0 ERROR: /opt/gitlab/embedded/lib/ruby/2.3.0/socket.rb:1207:in `__connect_nonblock'
This may be a problem when someone is using tools to monitor environment, because entrypoint effectively returns with 127 exit code. This is visible when you docker attach to the container and then stop it.
It looks like the reason is that sidekiq process is being SIGTERMed after redis server, thus redis already removed the socket.
Details: gitlab-qa!38 (comment 15934102)