Commit 0bfc8c11 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 30e48319
......@@ -353,8 +353,8 @@ error _Conn::close() {
// _pinner receives pin messages from wcfs and adjusts wconn file mappings.
error _Conn::_pinner(context::Context ctx) {
_Conn& wconn = *this;
error err = wconn.__pinner(ctx);
Conn wconn = newref(this); // newref for go
error err = wconn->__pinner(ctx);
// if pinner fails, wcfs will kill us.
// log pinner error so that the error is not hidden.
......@@ -365,18 +365,16 @@ error _Conn::_pinner(context::Context ctx) {
log::Fatalf("CRITICAL: wcfs server will likely kill us soon.");
fprintf(stderr, "CRITICAL: %s\n", v(err));
fprintf(stderr, "CRITICAL: wcfs server will likely kill us soon.\n");
}
// mark the connection non-operational if the pinner fails
// XXX deadlock wrt resync? (who read-locks wconn.filehMu)
// XXX -> mu -> downMu ?
wconn._filehMu.Lock(); // XXX locking ok? -> merge into below where lock is held?
if (wconn._downErr == nil) {
wconn._downErr = fmt::errorf("no longer operational due to: %w",
err != nil ? err : fmt::errorf("pinner exit"));
// XXX error -> wconn.down() = make all fileh and mapping invalid.
// mark the connection non-operational if the pinner fails.
//
// XXX go because wconn.close might deadlock wrt Conn.resync on
// wconn._filehMu, because Conn.resync sends "watch" updates under
// wconn._filehMu.
go([wconn]() {
wconn->close();
});
}
wconn._filehMu.Unlock();
return err;
}
......
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