Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGINT sent to Redis when exiting Foreman #525

Closed
jlecour opened this issue Feb 9, 2015 · 1 comment
Closed

SIGINT sent to Redis when exiting Foreman #525

jlecour opened this issue Feb 9, 2015 · 1 comment

Comments

@jlecour
Copy link

jlecour commented Feb 9, 2015

Hi,

Here is my Procfile :

web: bundle exec unicorn -c config/unicorn/development.rb
postgre: postgres -D /usr/local/var/postgres
mail: mailcatcher --foreground
redis: redis-server --port 7777 --dir ./tmp/ --dbfilename redis-dump.rdb

So I have a Redis server started by Foreman.
When I exit Foreman (with Ctrl-C), Redis receives a SIGINT

12:17:57 web.1     | started with pid 61957
12:17:57 postgre.1 | started with pid 61958
12:17:57 mail.1    | started with pid 61959
12:17:57 redis.1   | started with pid 61960
12:17:57 redis.1   | [61960] 09 Feb 12:17:57.435 * Increased maximum number of open files to 10032 (it was originally set to 4864).
12:17:57 redis.1   |                 _._
12:17:57 redis.1   |            _.-``__ ''-._
12:17:57 redis.1   |       _.-``    `.  `_.  ''-._           Redis 2.8.19 (00000000/0) 64 bit
12:17:57 redis.1   |   .-`` .-```.  ```\/    _.,_ ''-._
12:17:57 redis.1   |  (    '      ,       .-`  | `,    )     Running in stand alone mode
12:17:57 redis.1   |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 7777
12:17:57 redis.1   |  |    `-._   `._    /     _.-'    |     PID: 61960
12:17:57 redis.1   |   `-._    `-._  `-./  _.-'    _.-'
12:17:57 redis.1   |  |`-._`-._    `-.__.-'    _.-'_.-'|
12:17:57 redis.1   |  |    `-._`-._        _.-'_.-'    |           http://redis.io
12:17:57 redis.1   |   `-._    `-._`-.__.-'_.-'    _.-'
12:17:57 redis.1   |  |`-._`-._    `-.__.-'    _.-'_.-'|
12:17:57 redis.1   |  |    `-._`-._        _.-'_.-'    |
12:17:57 redis.1   |   `-._    `-._`-.__.-'_.-'    _.-'
12:17:57 redis.1   |       `-._    `-.__.-'    _.-'
12:17:57 redis.1   |           `-._        _.-'
12:17:57 redis.1   |               `-.__.-'
12:17:57 redis.1   |
12:17:57 redis.1   | [61960] 09 Feb 12:17:57.438 # Server started, Redis version 2.8.19
12:17:57 redis.1   | [61960] 09 Feb 12:17:57.438 * DB loaded from disk: 0.000 seconds
12:17:57 redis.1   | [61960] 09 Feb 12:17:57.438 * The server is now ready to accept connections on port 7777
12:17:57 postgre.1 | LOG:  database system was shut down at 2015-02-09 12:17:53 CET
12:17:57 postgre.1 | LOG:  autovacuum launcher started
12:17:57 postgre.1 | LOG:  database system is ready to accept connections
12:17:58 web.1     | I, [2015-02-09T12:17:58.399967 #61957]  INFO -- : unlinking existing socket=/Users/jlecour/Projects/trocdechambre/tmp/pids/unicorn.sock
12:17:58 web.1     | I, [2015-02-09T12:17:58.400276 #61957]  INFO -- : listening on addr=/Users/jlecour/Projects/trocdechambre/tmp/pids/unicorn.sock fd=9
12:17:58 web.1     | I, [2015-02-09T12:17:58.401107 #61957]  INFO -- : listening on addr=0.0.0.0:3075 fd=10
12:17:58 web.1     | I, [2015-02-09T12:17:58.401220 #61957]  INFO -- : worker=0 spawning...
12:17:58 web.1     | I, [2015-02-09T12:17:58.402245 #61957]  INFO -- : master process ready
12:17:58 web.1     | I, [2015-02-09T12:17:58.403634 #61967]  INFO -- : worker=0 spawned pid=61967
12:17:58 web.1     | I, [2015-02-09T12:17:58.404084 #61967]  INFO -- : Refreshing Gem list
12:18:02 web.1     | I, [2015-02-09T12:18:02.531052 #61967]  INFO -- : worker=0 ready
^C12:18:05 redis.1   | [61960 | signal handler] (1423480685) Received SIGINT scheduling shutdown...
12:18:05 postgre.1 | LOG:  received fast shutdown request
12:18:05 postgre.1 | LOG:  aborting any active transactions
SIGINT received
12:18:05 system    | sending SIGTERM to all processes
12:18:05 redis.1   | exited with code 0
12:18:05 postgre.1 | exited with code 0
12:18:05 mail.1    | exited with code 0
12:18:05 web.1     | exited with code 0

You can see at 12:18:05 I hit Ctrl-C, then Redis and PostgreSQL receive a SIGINT before the system sends a SIGTERM to all processes.

I'm using Foreman 0.77.0.

PS : sometimes, the PostgreSQL process doesn't immediately receives the SIGINT and gets the SIGTERM. I don't know why.

@Shashwat986
Copy link

I'm still facing the same problem:

41822:C 13 May 20:24:24.629 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
41822:C 13 May 20:24:24.629 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=41822, just started
41822:C 13 May 20:24:24.629 # Configuration loaded
41822:M 13 May 20:24:24.630 * Increased maximum number of open files to 10032 (it was originally set to 256).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.2 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6381
 |    `-._   `._    /     _.-'    |     PID: 41822
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

41822:M 13 May 20:24:24.632 # Server initialized
41822:M 13 May 20:24:29.219 * DB loaded from disk: 4.587 seconds
41822:M 13 May 20:24:29.219 * Ready to accept connections
^C41822:signal-handler (1526223280) Received SIGINT scheduling shutdown...
41822:signal-handler (1526223280) You insist... exiting now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants