You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Luke Cwik (Jira)" <ji...@apache.org> on 2020/04/08 19:48:00 UTC

[jira] [Updated] (BEAM-9399) Possible deadlock between DataflowWorkerLoggingHandler and overridden System.err PrintStream

     [ https://issues.apache.org/jira/browse/BEAM-9399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luke Cwik updated BEAM-9399:
----------------------------
    Status: Open  (was: Triage Needed)

> Possible deadlock between DataflowWorkerLoggingHandler and overridden System.err PrintStream
> --------------------------------------------------------------------------------------------
>
>                 Key: BEAM-9399
>                 URL: https://issues.apache.org/jira/browse/BEAM-9399
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-dataflow
>            Reporter: Sam Whittle
>            Assignee: Sam Whittle
>            Priority: Minor
>             Fix For: 2.21.0
>
>          Time Spent: 5h 40m
>  Remaining Estimate: 0h
>
> When an exception is encountered in DataflowWorkerLoggingHandler the ErrorManager is used to log the exception.  ErrorManager uses System.err which is overridden to be a PrintStream that writes back into DataflowWorkerLoggingHandler.
> This has the lock ordering DataflowWorkerLoggingHandler -> PrintStream.
> Other logging of System.err has the inverse lock ordering PrintStream->DataflowWorkerLoggingHandler so there is potential for deadlock.
> This is one known cause of the inversion, but any other System.err logs from inside DataflowWorkerLoggingHandler could cause the same issue.
> Proposed fix is to address low-hanging fruit of having ErrorManager output to the original System.err.  A full fix would be to improve our override of System.err to a PrintStream that can detect the locking inversion or possibly we could use the PrintStream mutex in both cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)