Skip to content
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

Channel gets deinitialized on main thread #96

Closed
edopelawi opened this issue Dec 20, 2017 · 5 comments
Closed

Channel gets deinitialized on main thread #96

edopelawi opened this issue Dec 20, 2017 · 5 comments

Comments

@edopelawi
Copy link

Hi all,

I'm currently using the 0.1.13 version, and I got some issue on Channel's deinitialization.

The issue occurs intermittently. On my source code, I wrapped the Protobuf-generated GRPC services, and each time the wrapper object gets deinitialized, the same thing happens on the opened Channel. Based on the stack I captured, it calls the cgrpc_channel_destroy, which calls blocking grpc_pollset_work.

Here's a screenshot of the stack:

screen shot 2017-12-20 at 16 36 47

Is there a way to make the process non-blocking? Or is it already fixed on the newer versions?

Thanks in advance!

@timburks
Copy link
Member

Hi, could you share your client code with me (timburks at google dot com) or try a newer version? The generated code now contains blocking versions of all unary (nonstreaming) API client handlers.

@edopelawi
Copy link
Author

Hi Tim, thanks for the response!

I'm not sure I could share the client code, but I could definitely try upgrading the version. Does the newer one still supports Swift 3?

@timburks
Copy link
Member

timburks commented Jan 6, 2018

I'm not testing with Swift 3 but don't recall any significant changes for Swift 4 (apart from the Datastore example, which uses Codable).

@edopelawi
Copy link
Author

@timburks, I forgot to update this thread until this issue bits me again recently :| I tried to update to 0.3.3... and yeah, the problem is still there.

I tried to dig in a little bit, and found out that the cgrpc_completion_queue_drain(c->completion_queue); in CgRPC's channel.c might be using main thread... and I found no way to change the queue to something else, either :(

Is there any way to send this process to background? I tried to wrap the process of assigning nil to the GRPC property inside a background DispatchQueue, but it still came back to main thread...

@MrMage MrMage mentioned this issue Mar 22, 2018
36 tasks
@MrMage
Copy link
Collaborator

MrMage commented Jul 3, 2019

Closing this now; please open a new issue if the issue persists in Swift gRPC 0.9.0.

@MrMage MrMage closed this as completed Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants