client warn when operation implicitly canceled

This commit is contained in:
Michael Davidsaver
2020-03-09 13:33:40 -07:00
parent ecbb06e740
commit 51f005d62e
3 changed files with 33 additions and 10 deletions
+11 -4
View File
@@ -39,7 +39,7 @@ struct GPROp : public OperationBase
:OperationBase (op, chan)
{}
~GPROp() {
cancel();
_cancel(true);
}
void notify() {
@@ -57,11 +57,18 @@ struct GPROp : public OperationBase
}
}
virtual void cancel() override final
{
virtual void cancel() override final {
_cancel(false);
}
void _cancel(bool implicit) {
auto context = chan->context;
decltype (done) junk;
context->tcp_loop.call([this, &junk](){
context->tcp_loop.call([this, &junk, implicit](){
if(implicit && state!=Done) {
log_warn_printf(setup, "implied cancel of op%x on channel '%s'\n",
op, chan ? chan->name.c_str() : "");
}
if(state==GetOPut || state==Exec) {
chan->conn->sendDestroyRequest(chan->sid, ioid);