-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server-side streaming must call hasNext() before cancel #10490
Comments
This is a problem caused by an optimization called ThreadlessExecutor. I think you just happened to stumble on a workaround. You are doing a good thing to cancel the RPC using the Context, but a message is getting stuck in an executor and leaking. For the iterator, I'd suggest to always drain it until it is empty. You could drain it after the CancellableContext is closed, but it will end up throwing an exception which is ugly. This looks like enough of a problem that we should probably remove the ThreadlessExecutor optimization for it, though. @larry-safran, would you mind removing the custom executor for the iterator API? The iterator-based API is broken/painful in a lot of ways. #10318 is a new API to replace it. |
* Remove ThreadlessExecutor from BlockingServerStream fixes #10490
* Remove ThreadlessExecutor from BlockingServerStream fixes grpc#10490
hello, when i use server-side streaming, i have a problem.
i get iterators from server list, put them into priority queue. i only get top n from queue. after called many times, i get OutOfMemoryError.
exception:
my client code like this:
but when i add this, this exception do not appear.
i don't know why, can someone help me explain?
The text was updated successfully, but these errors were encountered: