pipe: avoid needless use of exceptions
pipe: avoid needless use of exceptions

When closing the read-end side of the pipe, we need to notify the writer
only if it was blocked in write() on a full pipe - because if it wasn't
blocked, it will get the broken pipe on the next write() attempt.

We used queue::abort() for that, which is fine, because this function
won't do anything if nobody is waiting on a full buffer. But we still
call std::make_exception_ptr() unconditionally, which is slow (involves
throwing an exception and catching it) and an annoying false-alarm when
trying to debug with gdb's "catch throw" (which stops on any throw).

So this patch does

       if (_buf.full()) {
            _buf.abort(std::make_exception_ptr(broken_pipe_exception()));
       }

So that in the typical case when the buffer was not full (hopefully it
is empty), we don't do anything.

Signed-off-by: Nadav Har'El <625169824b719df98706d88646d0aae6f368ae4d@cloudius-systems.com>

guiquanz/scylla,kangkot/scylla,cloudius-systems/seastar,linearregression/scylla,acbellini/scylla,norcimo5/seastar,senseb/scylla,victorbriz/scylla,avikivity/seastar,scylladb/scylla-seastar,linearregression/seastar,phonkee/scylla,xtao/seastar,bowlofstew/seastar,duarten/scylla,eklitzke/scylla,dwdm/scylla,tempbottle/scylla,bzero/seastar,kjniemi/seastar,bowlofstew/seastar,jonathanleang/seastar,stamhe/seastar,tempbottle/scylla,scylladb/scylla,xtao/seastar,syuu1228/seastar,scylladb/scylla,bowlofstew/scylla,dwdm/scylla,stamhe/scylla,wildinto/scylla,syuu1228/seastar,linearregression/seastar,avikivity/scylla,victorbriz/scylla,sjperkins/seastar,asias/scylla,capturePointer/scylla,koolhazz/seastar,duarten/scylla,hongliangzhao/seastar,mixja/seastar,eklitzke/scylla,tempbottle/scylla,sjperkins/seastar,rluta/scylla,cloudius-systems/seastar,kjniemi/seastar,bzero/seastar,scylladb/scylla-seastar,leejir/seastar,justintung/scylla,raphaelsc/scylla,mixja/seastar,norcimo5/seastar,kjniemi/scylla,rluta/scylla,tempbottle/seastar,bowlofstew/scylla,kjniemi/scylla,acbellini/seastar,aruanruan/scylla,dwdm/scylla,anzihenry/seastar,capturePointer/scylla,xtao/seastar,stamhe/seastar,dwdm/seastar,kjniemi/seastar,joerg84/seastar,stamhe/scylla,kangkot/scylla,scylladb/scylla,flashbuckets/seastar,jonathanleang/seastar,tempbottle/seastar,linearregression/scylla,rentongzhang/scylla,avikivity/seastar,chunshengster/seastar,flashbuckets/seastar,acbellini/seastar,shyamalschandra/seastar,justintung/scylla,syuu1228/seastar,joerg84/seastar,senseb/scylla,stamhe/scylla,kangkot/scylla,linearregression/seastar,joerg84/seastar,cloudius-systems/seastar,printedheart/seastar,koolhazz/seastar,capturePointer/scylla,rentongzhang/scylla,norcimo5/seastar,acbellini/scylla,shaunstanislaus/scylla,chunshengster/seastar,shaunstanislaus/scylla,rluta/scylla,shyamalschandra/seastar,justintung/scylla,senseb/scylla,respu/scylla,jonathanleang/seastar,wildinto/seastar,dreamsxin/seastar,flashbuckets/seastar,leejir/seastar,bowlofstew/scylla,hongliangzhao/seastar,scylladb/seastar,glommer/scylla,aruanruan/scylla,raphaelsc/scylla,scylladb/scylla-seastar,wildinto/scylla,wildinto/scylla,glommer/scylla,avikivity/scylla,gwicke/scylla,scylladb/seastar,aruanruan/scylla,stamhe/seastar,shaunstanislaus/scylla,sjperkins/seastar,hongliangzhao/seastar,guiquanz/scylla,gwicke/scylla,asias/scylla,koolhazz/seastar,scylladb/seastar,rentongzhang/scylla,dwdm/seastar,guiquanz/scylla,anzihenry/seastar,chunshengster/seastar,respu/scylla,anzihenry/seastar,asias/scylla,duarten/scylla,raphaelsc/scylla,wildinto/seastar,acbellini/seastar,acbellini/scylla,printedheart/seastar,leejir/seastar,dreamsxin/seastar,avikivity/seastar,victorbriz/scylla,avikivity/scylla,scylladb/scylla,glommer/scylla,gwicke/scylla,eklitzke/scylla,phonkee/scylla,shyamalschandra/seastar,kjniemi/scylla,printedheart/seastar,mixja/seastar,dwdm/seastar,respu/scylla,bowlofstew/seastar,linearregression/scylla,wildinto/seastar,tempbottle/seastar,phonkee/scylla,dreamsxin/seastar,bzero/seastar