Skip to content

bug: Compression in log-rotate plugin exceeds the default timeout of shell.run #8619

@alptugay

Description

@alptugay

Current Behavior

When rotating log files, the log-rotate plugin uses shell.run() function which has a default timeout of 10 seconds. When rotating big log files this timeout is exceeded thus the tar command is being killed with SIGTERM. This causes the rotated files to be incomplete, and also the log files doesn't get removed.

image

Expected Behavior

Logs should be rotated completely unless it takes more time than log rotate interval. Therefor the timeout of the shell.run() function should be the same as the interval value.

Error Logs

No response

Steps to Reproduce

Generate a log file (1GB or more) which takes more than 10 seconds to compress using tar -cvf
Let the log rotate plugin work

Environment

  • APISIX 2.15 but should be the same on v3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions