12 MB threshold for rename versus truncate
This commit is contained in:
		| @@ -155,8 +155,9 @@ sub rotate_logs { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   # if the log file's about 10M then the race condition in copy/truncate |   # if the log file's about 10M then the race condition in copy/truncate | ||||||
|   # has a low probability. if the file's larger, then we rename and kill |   # has a low risk of data loss. if the file's larger, then we rename and | ||||||
|   if ((-s $log_file) > (11 * 1024768)) { |   # kill. | ||||||
|  |   if ((-s $log_file) > (12 * 1024768)) { | ||||||
|       rename $log_file, $log_file .'.1'; |       rename $log_file, $log_file .'.1'; | ||||||
|       signal_child('TERM', $child); |       signal_child('TERM', $child); | ||||||
|       $child = fork_and_start(@_); |       $child = fork_and_start(@_); | ||||||
|   | |||||||
| @@ -169,8 +169,9 @@ sub rotate_logs { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   # if the log file's about 10M then the race condition in copy/truncate |   # if the log file's about 10M then the race condition in copy/truncate | ||||||
|   # has a low probability. if the file's larger, then we rename and kill |   # has a low risk of data loss. if the file's larger, then we rename and | ||||||
|   if ((-s $log_file) > (15 * 1024768)) { |   # kill. | ||||||
|  |   if ((-s $log_file) > (12 * 1024768)) { | ||||||
|       rename $log_file, $log_file .'.1'; |       rename $log_file, $log_file .'.1'; | ||||||
|       signal_child('HUP', $child); |       signal_child('HUP', $child); | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user