--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/9e84949d-139c-43df-a09e-5d8cc79022be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/90ba2085-8fb9-4851-9ae7-75ad45a5021d%40googlegroups.com.
Hmm; I'm having some luck looking at the context, which quite happily changes from is_active() to not is_active() the instant I kill the waiting client. So I thought I'd proceed with something like
while not my_future.done():if not context.is_active():my_future.cancel()
Terminating the worker thread/process is actually vexing me though! I tried having a ThreadPoolExecutor to give me a future for the worker task, but you can't really cancel a future from a thread, it turns out (you can only cancel it if it hasn't started running; once it's started, it still goes to completion). So I've tried having a separate ProcessPoolExecutor (maybe processes can be killed?) but that's not actually going so well either, as attempts to use that to generate futures results in some odd "Failed accept4: Invalid Argument" errors which I can't quite work through.
Most confusing. I wonder if I'll need to subclass grpc.server or if my servicer can manually run a secondary process or some such.
Still, surprising to me this isn't a solved problem built into GRPC. I feel like I'm missing something really obvious.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/733b0293-6162-47c8-85f7-28cfa0b932b8%40googlegroups.com.
Thanks, Eric. That makes some degree of sense, although there are a few cases we still won't be able to deal with, I suspect (and we may have trouble later anyway... in some cases our server program has to shell out to run a separate program, and if that runs into the fork trouble and can't be supported by GRPC we may be stuck with a very clanky REST implementation).
Hmm, quite a pickle. I can see I'll be playing with a bunch of toy problems for a bit before even considering doing a migration to GRPC. Most disagreeable, but we'll see what we get.
Can grpc client stubs be used from within grpc servicers? (imagining fracturing this whole thing into microservices even if that doesn't solve this particular problem).
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/e67efea6-e740-4e08-90c1-b093b85a9914%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/3FdOOF7AK1g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/9109d969-ade6-485d-b60d-792e75b18123%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/6baa9d8e-3a7d-486d-8437-f4885908ebdb%40googlegroups.com.