Commit 30e48319 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 58e5bc78
...@@ -556,6 +556,15 @@ error _Conn::resync(zodb::Tid at) { ...@@ -556,6 +556,15 @@ error _Conn::resync(zodb::Tid at) {
wconn._atMu.RUnlock(); wconn._atMu.RUnlock();
etrace(""); etrace("");
// bring wconn + fileh + mmaps down on error
bool retok = false;
defer([&]() {
if (!retok)
// XXX log?
//fprintf(stderr, "\n\nTODO: bring wconn + fileh + mmaps down on error\n\n\n");
wconn.close(); // ignore error
});
// XXX downErr -> E // XXX downErr -> E
// XXX at ^ (increases) // XXX at ^ (increases)
...@@ -587,13 +596,6 @@ error _Conn::resync(zodb::Tid at) { ...@@ -587,13 +596,6 @@ error _Conn::resync(zodb::Tid at) {
if (err != nil) if (err != nil)
return E(err); return E(err);
bool retok = false;
defer([&]() {
if (!retok)
//panic("TODO: bring wconn + fileh + mmaps down on error"); // XXX
fprintf(stderr, "\n\nTODO: bring wconn + fileh + mmaps down on error\n\n\n");
});
// set new wconn.at early, so that e.g. Conn.open running simultaneously // set new wconn.at early, so that e.g. Conn.open running simultaneously
// to second part of resync (see below) uses new at. // to second part of resync (see below) uses new at.
wconn.at = at; wconn.at = at;
...@@ -611,7 +613,7 @@ error _Conn::resync(zodb::Tid at) { ...@@ -611,7 +613,7 @@ error _Conn::resync(zodb::Tid at) {
FileH f = fit.second; FileH f = fit.second;
// TODO if file has no mappings and was not used during whole prev // TODO if file has no mappings and was not used during whole prev
// cycle - forget and stop watching it // cycle - forget and stop watching it?
// "opening" or "closing" fileh - their setup/teardown is currently // "opening" or "closing" fileh - their setup/teardown is currently
// handled by Conn.open and FileH.close correspondingly. // handled by Conn.open and FileH.close correspondingly.
......
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