Use of handleCancel() in sendMessage() callbacks is dubious
zenhack opened this issue · comments
Ian Denhardt commented
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.
Ian Denhardt commented
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.