Branch: refs/heads/develop

  Home:   https://github.com/jenkinsci/log-parser-plugin

  Commit: bff7f9f53820aade452a4c44441bbfabc905931e

      
https://github.com/jenkinsci/log-parser-plugin/commit/bff7f9f53820aade452a4c44441bbfabc905931e

  Author: Jørgen P. Tjernø <jor...@tjer.no>

  Date:   2022-09-10 (Sat, 10 Sep 2022)



  Changed paths:

    M src/main/java/hudson/plugins/logparser/LogParserParser.java



  Log Message:

  -----------

  fix(Memory): Correct potential OOM when parsing logs in workflows (#36)



`WorkflowRun.getLogInputStream` will read the entire log output into a

`ByteArrayOutputStream`, then construct a `ByteArrayInputStream` from

that buffer, which we then construct a `InputStreamReader` from.

(https://github.com/jenkinsci/workflow-job-plugin/blob/1551f82/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java#L1105)



If the log is large, this will potentially cause a

`java.lang.OutOfMemoryError`. Instead, use `build.getLogReader()`, which

simply constructs an `InputStreamReader` that wraps the underlying

source log session.



For `hudson.model.Run` this should have no impact, as its

`getLogReader()` just constructs an `InputStreamReader` the same way we

used to.





-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/log-parser-plugin/push/refs/heads/develop/1a5ef7-bff7f9%40github.com.

Reply via email to