{"action":"created","issue":{"url":"https://api.github.com/repos/sbt/sbt/issues/3737","repository_url":"https://api.github.com/repos/sbt/sbt","labels_url":"https://api.github.com/repos/sbt/sbt/issues/3737/labels{/name}","comments_url":"https://api.github.com/repos/sbt/sbt/issues/3737/comments","events_url":"https://api.github.com/repos/sbt/sbt/issues/3737/events","html_url":"https://github.com/sbt/sbt/issues/3737","id":273738549,"number":3737,"title":"Forked runs report noisy \"Stream closed\" exception with stack trace when process is stopped","user":{"login":"jrudolph","id":9868,"avatar_url":"https://avatars1.githubusercontent.com/u/9868?v=4","gravatar_id":"","url":"https://api.github.com/users/jrudolph","html_url":"https://github.com/jrudolph","followers_url":"https://api.github.com/users/jrudolph/followers","following_url":"https://api.github.com/users/jrudolph/following{/other_user}","gists_url":"https://api.github.com/users/jrudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/jrudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrudolph/subscriptions","organizations_url":"https://api.github.com/users/jrudolph/orgs","repos_url":"https://api.github.com/users/jrudolph/repos","events_url":"https://api.github.com/users/jrudolph/events{/privacy}","received_events_url":"https://api.github.com/users/jrudolph/received_events","type":"User","site_admin":false},"labels":[{"id":706644972,"url":"https://api.github.com/repos/sbt/sbt/labels/Blocked%20on%20Upstream","name":"Blocked on Upstream","color":"816c5b","default":false},{"id":118566,"url":"https://api.github.com/repos/sbt/sbt/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":133823904,"url":"https://api.github.com/repos/sbt/sbt/labels/Regression","name":"Regression","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-11-14T10:23:15Z","updated_at":"2018-02-15T13:33:24Z","closed_at":null,"author_association":"MEMBER","body":"During/after shutting down a forked process (started with runMain), often (most of the times?) an exception like this is shown:\r\n\r\n```\r\nException in thread \"Thread-221\" java.io.IOException: Stream closed\r\n\tat java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)\r\n\tat java.io.OutputStream.write(OutputStream.java:116)\r\n\tat java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)\r\n\tat java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)\r\n\tat java.io.FilterOutputStream.close(FilterOutputStream.java:158)\r\n\tat scala.sys.process.BasicIO$.$anonfun$input$1(BasicIO.scala:200)\r\n\tat scala.sys.process.BasicIO$.$anonfun$input$1$adapted(BasicIO.scala:198)\r\n\tat scala.sys.process.ProcessBuilderImpl$Simple.$anonfun$run$2(ProcessBuilderImpl.scala:75)\r\n\tat scala.sys.process.ProcessImpl$Spawn$$anon$1.run(ProcessImpl.scala:23)\r\n```\r\n\r\nI suspect it is related to `connectInput := true`. It can be reproduced by running any of the test main classes in akka-http / akka-http-core sub project (while also enabling forking and connectInput).\r\n\r\nsbt 1.0.3"},"comment":{"url":"https://api.github.com/repos/sbt/sbt/issues/comments/365928193","html_url":"https://github.com/sbt/sbt/issues/3737#issuecomment-365928193","issue_url":"https://api.github.com/repos/sbt/sbt/issues/3737","id":365928193,"user":{"login":"jrudolph","id":9868,"avatar_url":"https://avatars1.githubusercontent.com/u/9868?v=4","gravatar_id":"","url":"https://api.github.com/users/jrudolph","html_url":"https://github.com/jrudolph","followers_url":"https://api.github.com/users/jrudolph/followers","following_url":"https://api.github.com/users/jrudolph/following{/other_user}","gists_url":"https://api.github.com/users/jrudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/jrudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrudolph/subscriptions","organizations_url":"https://api.github.com/users/jrudolph/orgs","repos_url":"https://api.github.com/users/jrudolph/repos","events_url":"https://api.github.com/users/jrudolph/events{/privacy}","received_events_url":"https://api.github.com/users/jrudolph/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T13:33:24Z","updated_at":"2018-02-15T13:33:24Z","author_association":"MEMBER","body":"> AFAIK Paul imported Mark's process code into scala.sys.process. I guess they diverged.\r\n\r\nI compared parts of the code. It seems that the `scala.sys.process` version tries to close the stream (probably to prevent a resource leak?) after processing without discarding potential errors that could happen during closing:\r\n\r\nhttps://github.com/scala/scala/blob/3610019ade5f6f23215672d4ff5f74c37f90b38d/src/library/scala/sys/process/BasicIO.scala#L200\r\n\r\nMaybe it would suffice to wrap that `close` call to ignore exceptions during its execution?"}}
{"actor":{"display_login":"jrudolph"}}