oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.29k stars 739 forks source link

limit the output length in Command.OutputThread#run() #4474

Closed vladak closed 8 months ago

vladak commented 8 months ago

The Command class (used within CommandSequence for commands such as opengrok-sync) has a OutputThread sub-class that is meant to capture the output produced by the running command. When the output is very long (such as the one in #4473), this can cause memory shortage in the system. Thus, the out array should be bounded, becoming a circular buffer.

I.e. this place https://github.com/oracle/opengrok/blob/86b9d980ae227915bff8d7863dbeac2593e8257f/tools/src/main/python/opengrok_tools/utils/command.py#L188 needs to be changed.

vladak commented 8 months ago

Also, while there, some thought should be given to whether limit the lines themselves if they are longer than certain threshold.