Commit c11843b4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 96a1efae
...@@ -199,6 +199,20 @@ error _Conn::_pinner(context::Context ctx) { // XXX error -> where? ...@@ -199,6 +199,20 @@ error _Conn::_pinner(context::Context ctx) { // XXX error -> where?
_Conn& wconn = *this; _Conn& wconn = *this;
// XXX panic/exc -> log.CRITICAL // XXX panic/exc -> log.CRITICAL
#if 0
// if pinner fails, wcfs will kill us.
// log pinner exception so the error is not hidden.
// print to stderr as well as by default log does not print to there.
def _():
exc = sys.exc_info()[1]
if exc in (None, context.canceled): # canceled = .close asks pinner to stop
return
log.critical('pinner failed:', exc_info=1)
print('CRITICAL: pinner failed:', file=sys.stderr)
traceback.print_exc(file=sys.stderr)
print('\nCRITICAL: wcfs server will likely kill us soon.', file=sys.stderr)
defer(_)
#endif
PinReq req; PinReq req;
error err; error err;
...@@ -219,9 +233,22 @@ error _Conn::_pinner(context::Context ctx) { // XXX error -> where? ...@@ -219,9 +233,22 @@ error _Conn::_pinner(context::Context ctx) { // XXX error -> where?
void _Conn::_pin1(PinReq *req) { void _Conn::_pin1(PinReq *req) {
_Conn& wconn = *this; _Conn& wconn = *this;
// XXX defer: reply either ack or nak on error
// XXX return error? // XXX return error?
// XXX defer: reply either ack or nak on error
#if 0
// reply either ack or nak on error
def _():
ack = "ack"
exc = sys.exc_info()[1]
if exc is not None:
ack = "nak: %s" % exc
#req.reply(ack)
ctx = context.background() # XXX ok?
wconn._wlink.replyReq(ctx, req, ack)
defer(_)
#endif
_File *f; _File *f;
bool ok; bool ok;
wconn._filemu.lock(); wconn._filemu.lock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment