capnproto / go-capnp

Cap'n Proto library and code generator for Go

Home Page:https://capnproto.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of handleCancel() in sendMessage() callbacks is dubious

zenhack opened this issue · comments

e.g. in Conn.Bootstrap() and question.PipelineSend(); Per #327 it is possible for this to not be run until the drainQueue() step in shutdown, so we probably need to be more careful about what things we allow to happen here. In particular, handleCancel can itself trigger messages, which is likely not to do what we intend.

We should audit this for correctness.

I went through and audited these, and have come to the conclusion that they're fine actually. They are only executed when err == nil, which excludes the scenario where we're already shutting down.

Closing.