alptugay commented on code in PR #8620:
URL: https://github.com/apache/apisix/pull/8620#discussion_r1263810793
##########
apisix/plugins/log-rotate.lua:
##########
@@ -277,6 +277,7 @@ local function rotate()
max_size = attr.max_size or max_size
enable_compression = attr.enable_compression or enable_compression
end
+ local timeout = interval * 100 -- Timeout for compression is interval in
milliseconds
Review Comment:
> What if the compression starts just before the next rotation?
Rotation is done in intervals. Execution step is like below in simple terms:
1) Rename current log file to logfile.date
2) Send signal to process so new file opens
3) compress logfile.date with a timeout that is not bigger than the interval,
So I don't think step 3 will start just before next rotation.
But your second argument is valid, compression can still get a timeout if it
can't be finished in the specified interval. We can schedule it with ngx_timer
but this means those timers will add up. Assume the interval is 5 minutes and
compression takes 10 minutes, after 1 hour we will have done 12 intervals jobs
but only 6 compression will be completed and 6 will be waiting. So this will
add up and probably make the system unresponsive
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]