Skip to content

ServicerContext.is_active() returning True after client's disconnection #20259

@cscarpitta

Description

@cscarpitta

What version of gRPC and what language are you using?

grpcio==1.23.0
python

What operating system (Linux, Windows,...) and version?

Linux Xubuntu with kernel 5.2.0

What runtime / compiler are you using (e.g. python version or version of gcc)

python 2.7

What did you do?

I'm trying to use the stream gRPCs in my python application.
A client subscribes to a stream of updates once and receives all changes to the server state until the client disconnects (forcefully or gracefully).

What did you expect to see?

If the client disconnects forcefully I expect that ServicerContext.is_active() whould return False, so that I can check it and stop sending updates to the client.

What did you see instead?

ServicerContext.is_active() continues to return True when the client disconnects from the server.

Anything else we should know about your project / environment?

The bug has been already signaled in the past years
https://stackoverflow.com/questions/43948975/grpc-unary-streaming-continues-after-disconnect-blocks-on-interrupt

#11157

https://groups.google.com/forum/#!topic/grpc-io/45LxvLyYVLk

Is it possible to fix it?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions