Commit 1e7e5180 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 28b720a7
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
// Such requests originate from regular client threads - not pinner - via entry // Such requests originate from regular client threads - not pinner - via entry
// points like Conn.open, Conn.resync and FileH.close. // points like Conn.open, Conn.resync and FileH.close.
// //
// Every FileH maintains fileh._pinned {} with currently pinned blk -> rev. The // Every FileH maintains fileh._pinned {} with currently pinned blk -> rev. This
// dict is updated by pinner driven by pin messages, and is used when either // dict is updated by pinner driven by pin messages, and is used when either
// new fileh Mapping is created (FileH.mmap) or refreshed due to request from // new fileh Mapping is created (FileH.mmap) or refreshed due to request from
// virtmem (Mapping.remmap_blk, see below). // virtmem (Mapping.remmap_blk, see below).
...@@ -108,8 +108,8 @@ ...@@ -108,8 +108,8 @@
// -------- // --------
// //
// (*) see wcfs.go documentation for WCFS isolation protocol overview and details. // (*) see wcfs.go documentation for WCFS isolation protocol overview and details.
// (+) currently, for simplicity, there is one pinner for each connection. In // (+) currently, for simplicity, there is one pinner thread for each connection.
// the future, for efficiency, it might be reworked to be one pinner thread // In the future, for efficiency, it might be reworked to be one pinner thread
// that serves all connections simultaneously. // that serves all connections simultaneously.
...@@ -200,7 +200,7 @@ pair<Conn, error> WCFS::connect(zodb::Tid at) { ...@@ -200,7 +200,7 @@ pair<Conn, error> WCFS::connect(zodb::Tid at) {
return wconn->_pinner(ctx); return wconn->_pinner(ctx);
}); });
// need to wait till `wcfs/head/at ≥ at` because e.g. Conn.open stats stats // need to wait till `wcfs/head/at ≥ at` because e.g. Conn.open stats
// head/f to get f.headfsize. // head/f to get f.headfsize.
// XXX atMu.RLock ? // XXX atMu.RLock ?
err = wconn->_headWait(at); err = wconn->_headWait(at);
...@@ -307,7 +307,8 @@ error _Conn::_pinner(context::Context ctx) { ...@@ -307,7 +307,8 @@ error _Conn::_pinner(context::Context ctx) {
// XXX deadlock wrt resync? (who read-locks wconn.mu) // XXX deadlock wrt resync? (who read-locks wconn.mu)
wconn._mu.Lock(); // XXX locking ok? -> merge into below where lock is held? wconn._mu.Lock(); // XXX locking ok? -> merge into below where lock is held?
if (wconn._downErr == nil) { if (wconn._downErr == nil) {
wconn._downErr = fmt::errorf("no longer operational due to: %w", err); // XXX err=nil ? wconn._downErr = fmt::errorf("no longer operational due to: %w",
err != nil ? err : fmt::errorf("pinner exit"));
// XXX make all fileh and mapping invalid. // XXX make all fileh and mapping invalid.
} }
wconn._mu.Unlock(); wconn._mu.Unlock();
......
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