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

.

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