Commit 07700777 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a4a66607
...@@ -165,8 +165,10 @@ error _Conn::_pinner(context::Context ctx) { ...@@ -165,8 +165,10 @@ error _Conn::_pinner(context::Context ctx) {
// mark the connection non-operational if the pinner fails // mark the connection non-operational if the pinner fails
wconn._downMu.lock(); wconn._downMu.lock();
if (wconn._downErr == nil) if (wconn._downErr == nil) {
wconn._downErr = fmt::errorf("no longer operational due to: %s", v(err)); wconn._downErr = fmt::errorf("no longer operational due to: %s", v(err));
// XXX make all fileh and mapping invalid.
}
wconn._downMu.unlock(); wconn._downMu.unlock();
return err; return err;
...@@ -424,9 +426,13 @@ error _Conn::resync(zodb::Tid at) { ...@@ -424,9 +426,13 @@ error _Conn::resync(zodb::Tid at) {
xerr::Contextf E("conn @%s: resync -> @%s", v(wconn.at), v(at)); // XXX +wcfs path? xerr::Contextf E("conn @%s: resync -> @%s", v(wconn.at), v(at)); // XXX +wcfs path?
// XXX locking // XXX locking
error err;
if (wconn._downErr != nil) // XXX lock with _filehmu wconn._downMu.lock();
return E(wconn._downErr); err = wconn._downErr;
wconn._downMu.unlock();
if (err != nil)
return E(err);
for (auto fit : wconn._filehtab) { for (auto fit : wconn._filehtab) {
zodb::Oid foid = fit.first; zodb::Oid foid = fit.first;
...@@ -437,7 +443,7 @@ error _Conn::resync(zodb::Tid at) { ...@@ -437,7 +443,7 @@ error _Conn::resync(zodb::Tid at) {
// update f._headfsize and remmap to head/f zero regions that are now covered by head/f // update f._headfsize and remmap to head/f zero regions that are now covered by head/f
struct stat st; struct stat st;
error err = f->_headf->stat(&st); err = f->_headf->stat(&st);
if (err != nil) if (err != nil)
return E(err); return E(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