tporadowski / redis

Native port of Redis for Windows. Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs. This repository contains unofficial port of Redis to Windows.
http://redis.io
Other
9.04k stars 1.09k forks source link

Support CTRL_C_EVENT,CTRL_BREAK_EVENT signal #59

Open alexsilva opened 4 years ago

alexsilva commented 4 years ago

Describe the bug/issue I am currently testing redis version 4.0.14.2

But I have realized that sending the CTRL_C_EVENT signal to the redis process does not respond according to saving the data on the disk and ending the process.

The CTRL_BREAK_EVENT signal ends the redis process but does not appear to be saving data to disk.

To Reproduce Please provide more information about: The signal sending tests are being performed by the supervisor process management tool supervisor-win

Crash report Terminate redis via signal CTRL_BREAK_EVENT results in a unexpected code 3221225786.

Event Log At the Control + C terminal save the data and end the process.

[23260] 21 May 11:53:38.163 # Server initialized
[23260] 21 May 11:53:38.164 * Ready to accept connections
[23260] 21 May 11:53:38.164 - 0 clients connected (0 slaves), 660064 bytes in use
[23260] 21 May 11:53:43.189 - 0 clients connected (0 slaves), 660064 bytes in use
[23260] 21 May 11:53:48.212 - 0 clients connected (0 slaves), 660064 bytes in use
[23260] 21 May 11:53:53.235 - 0 clients connected (0 slaves), 660064 bytes in use
[23260] 21 May 11:53:57.355 # User requested shutdown...
[23260] 21 May 11:53:57.355 * Saving the final RDB snapshot before exiting.
[23260] 21 May 11:53:57.383 * DB saved on disk
[23260] 21 May 11:53:57.384 # Redis is now ready to exit, bye bye...

Additional context Please provide Windows version you are using, mode in which you are starting Redis (standalone, cluster, Sentinel), etc.

Is there anything that can be done for the redis process to end with signals (CTRL_BREAK_EVENT, CTRL_C_EVENT) and save the data before it ends?