{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3101","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3101/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3101/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3101/events","html_url":"https://github.com/jruby/jruby/issues/3101","id":92714344,"number":3101,"title":"IO.to_outputstream (a.k.a. RubyIO.getOutStream) returns a non-writable stream in some cases.","user":{"login":"raelik","id":53844,"avatar_url":"https://avatars.githubusercontent.com/u/53844?v=3","gravatar_id":"","url":"https://api.github.com/users/raelik","html_url":"https://github.com/raelik","followers_url":"https://api.github.com/users/raelik/followers","following_url":"https://api.github.com/users/raelik/following{/other_user}","gists_url":"https://api.github.com/users/raelik/gists{/gist_id}","starred_url":"https://api.github.com/users/raelik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raelik/subscriptions","organizations_url":"https://api.github.com/users/raelik/orgs","repos_url":"https://api.github.com/users/raelik/repos","events_url":"https://api.github.com/users/raelik/events{/privacy}","received_events_url":"https://api.github.com/users/raelik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-02T19:20:18Z","updated_at":"2015-07-02T19:22:24Z","closed_at":null,"body":"While doing some testing with chunked responses on a plain Rack app running under puma 2.11.3 (using rack.hijack to get access to the raw socket) on jruby 1.7.20.1, I was getting a \"not opened for writing\" IOException, which I traced back to checkWritable() in the ChannelStream class used internally by RubyIO.  The OutputStreamAdapter ultimately returned by getOutStream() uses checkWritable() in many places, so I was able to get around this issue by using getChannel() instead and wrapping it in my own OutputStream using Channels.newOutputStream().  This issue has been resolved in 9k via the overhaul of the IO system."},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/118139704","html_url":"https://github.com/jruby/jruby/issues/3101#issuecomment-118139704","issue_url":"https://api.github.com/repos/jruby/jruby/issues/3101","id":118139704,"user":{"login":"headius","id":10135,"avatar_url":"https://avatars.githubusercontent.com/u/10135?v=3","gravatar_id":"","url":"https://api.github.com/users/headius","html_url":"https://github.com/headius","followers_url":"https://api.github.com/users/headius/followers","following_url":"https://api.github.com/users/headius/following{/other_user}","gists_url":"https://api.github.com/users/headius/gists{/gist_id}","starred_url":"https://api.github.com/users/headius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headius/subscriptions","organizations_url":"https://api.github.com/users/headius/orgs","repos_url":"https://api.github.com/users/headius/repos","events_url":"https://api.github.com/users/headius/events{/privacy}","received_events_url":"https://api.github.com/users/headius/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T19:22:24Z","updated_at":"2015-07-02T19:22:24Z","body":"So was it returning an OutputStream wrapping a read-only channel? Channels.toOutputStream should be doing the right thing..."}}