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 connectivityState crash after shutdown #488

Open
3 tasks done
a-voronov opened this issue Jun 18, 2019 · 0 comments
Open
3 tasks done

Channel connectivityState crash after shutdown #488

a-voronov opened this issue Jun 18, 2019 · 0 comments
Labels
cgrpc Relates to the CgRPC based version of gRPC Swift

Comments

@a-voronov
Copy link

New Issue Checklist

Issue Description

I'm using Swift gRPC on iOS and trying to keep connection when device switches between wifi<>cellular or different cellular technologies as suggested here #337.

So I shutdown active service client channel. And next time I talk to client, I want to check whether it's shutdown or not, so I can decide if I need to create new client or use the current one.
The only way to do it AFAIK is to call its channel's connectivityState method.
But I get EXC_BAD_ACCESS when calling it, after channel was shutdown.
I suppose it happens after underlying channel pointer is freed in shutdown method and I try to access if afterwards in connectivityState method.

I don't know much about implementation details whether we should keep underlying channel pointer alive so we can keep using it to get its state, or whether we should rely on some secondary knowledge if it was shutdown like hasBeenShutdown private flag, so I couldn't create PR to fix it.

Environment

Key Value
OS Version 10.14.4
Swift Version 4.2
Xcode Version 10.2.1
gRPC-Swift Version 0.9.0
@glbrntt glbrntt added the cgrpc Relates to the CgRPC based version of gRPC Swift label Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cgrpc Relates to the CgRPC based version of gRPC Swift
Projects
None yet
Development

No branches or pull requests

2 participants