{"action":"closed","issue":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/887","labels_url":"https://api.github.com/repos/grpc/grpc-java/issues/887/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-java/issues/887/comments","events_url":"https://api.github.com/repos/grpc/grpc-java/issues/887/events","html_url":"https://github.com/grpc/grpc-java/issues/887","id":103596479,"number":887,"title":"OkHttp: race between sendCancel and sendFrame.","user":{"login":"madongfly","id":1962333,"avatar_url":"https://avatars.githubusercontent.com/u/1962333?v=3","gravatar_id":"","url":"https://api.github.com/users/madongfly","html_url":"https://github.com/madongfly","followers_url":"https://api.github.com/users/madongfly/followers","following_url":"https://api.github.com/users/madongfly/following{/other_user}","gists_url":"https://api.github.com/users/madongfly/gists{/gist_id}","starred_url":"https://api.github.com/users/madongfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madongfly/subscriptions","organizations_url":"https://api.github.com/users/madongfly/orgs","repos_url":"https://api.github.com/users/madongfly/repos","events_url":"https://api.github.com/users/madongfly/events{/privacy}","received_events_url":"https://api.github.com/users/madongfly/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/grpc/grpc-java/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/grpc/grpc-java/labels/okhttp","name":"okhttp","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":{"login":"madongfly","id":1962333,"avatar_url":"https://avatars.githubusercontent.com/u/1962333?v=3","gravatar_id":"","url":"https://api.github.com/users/madongfly","html_url":"https://github.com/madongfly","followers_url":"https://api.github.com/users/madongfly/followers","following_url":"https://api.github.com/users/madongfly/following{/other_user}","gists_url":"https://api.github.com/users/madongfly/gists{/gist_id}","starred_url":"https://api.github.com/users/madongfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madongfly/subscriptions","organizations_url":"https://api.github.com/users/madongfly/orgs","repos_url":"https://api.github.com/users/madongfly/repos","events_url":"https://api.github.com/users/madongfly/events{/privacy}","received_events_url":"https://api.github.com/users/madongfly/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/grpc/grpc-java/milestones/4","html_url":"https://github.com/grpc/grpc-java/milestones/Beta%20(0.9.0)","labels_url":"https://api.github.com/repos/grpc/grpc-java/milestones/4/labels","id":1252678,"number":4,"title":"Beta (0.9.0)","description":"","creator":{"login":"carl-mastrangelo","id":8943572,"avatar_url":"https://avatars.githubusercontent.com/u/8943572?v=3","gravatar_id":"","url":"https://api.github.com/users/carl-mastrangelo","html_url":"https://github.com/carl-mastrangelo","followers_url":"https://api.github.com/users/carl-mastrangelo/followers","following_url":"https://api.github.com/users/carl-mastrangelo/following{/other_user}","gists_url":"https://api.github.com/users/carl-mastrangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/carl-mastrangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carl-mastrangelo/subscriptions","organizations_url":"https://api.github.com/users/carl-mastrangelo/orgs","repos_url":"https://api.github.com/users/carl-mastrangelo/repos","events_url":"https://api.github.com/users/carl-mastrangelo/events{/privacy}","received_events_url":"https://api.github.com/users/carl-mastrangelo/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":29,"state":"open","created_at":"2015-08-12T22:46:45Z","updated_at":"2015-08-28T05:39:24Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-08-27T21:14:57Z","updated_at":"2015-08-28T05:39:24Z","closed_at":"2015-08-28T05:39:24Z","body":"If sendCancel is called (by timeout for example) before the stream is started, a following sendFrame will cause a NPE:\r\n```\r\njava.lang.NullPointerException\r\n\tat io.grpc.okhttp.OkHttpClientStream.sendFrame(OkHttpClientStream.java:197)\r\n\tat io.grpc.internal.AbstractClientStream.internalSendFrame(AbstractClientStream.java:199)\r\n\tat io.grpc.internal.AbstractStream$2.deliverFrame(AbstractStream.java:128)\r\n\tat io.grpc.internal.MessageFramer.commitToSink(MessageFramer.java:297)\r\n\tat io.grpc.internal.MessageFramer.flush(MessageFramer.java:255)\r\n\tat io.grpc.internal.AbstractStream.flush(AbstractStream.java:178)\r\n\tat io.grpc.ClientCallImpl.sendMessage(ClientCallImpl.java:213)\r\n\tat io.grpc.stub.ClientCalls$CallToStreamObserverAdapter.onNext(ClientCalls.java:210)\r\n\tat io.grpc.testing.integration.AbstractTransportTest.timeoutOnSleepingServer(AbstractTransportTest.java:843)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\r\n\tat org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)\r\n```"}}