handle MemoryError by failing quickly and loudly #651
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#651
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When I tried to update my klog -- http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:j74uhg25nwdpjpacl6rkat2yhm:kav7ijeft5h7r7rxdp5bgtlt3viv32yabqajkrdykozia5544jqa/wiki.html # (testgrid) -- a couple of days ago I got an UncoordinatedWriteError. I also got an UncoordinatedWriteError when I tried to make a new unlinked directory on the test grid. The incident report from one of those is attached as 'incident-2009-02-27-215731-aj5o5ti.flog.bz2' . It contains the following lines:
This reminds me of an issue that I thought we had fixed before the 1.3.0 release -- #546 (mutable-file surprise shares raise inappropriate UCWE).
At the time I did a check on my klog and saw that most of its shared were on a single storage server:
This morning I tried again to update my klog, and this time I got a KeyError (full HTML output attached as "KeyError.html"). Doing a check now shows:
I just now verified that bs3c1 is connected to my client:
Then tried to load the write-cap to my klog again, got KeyError again, then did a check and got the same check results as above, then confirmed that bs3c1 is still connected.
So, what's going on? Is bs3c1 failing to respond to my client's requests, or has it somehow deleted the shares of my klog that it held a couple of days ago?
Oh! I see that I can access the read-only view of my klog through http://testgrid.allmydata.org:3567 even though I can't access the exact same URL with my local tahoe node. So either there is a networking problem, or there is a problem with the version of tahoe that I'm running here (allmydata-tahoe: 1.3.0-r3698, foolscap: 0.3.2, pycryptopp: 0.5.12, zfec: 1.4.4, Twisted: 8.2.0) but not the version running on testgrid (allmydata-tahoe: 1.3.0, foolscap: 0.3.2, pycryptopp: 0.5.2-1, zfec: 1.4.0-4, Twisted: 2.5.0).
Here's the result of a check (and verify) on the read-only view of the directory through testgrid.allmydata.org:
The most recent incident in my local incidents log says:
The full incident is attached as incident-2009-03-04-115318-ebt4x5a.flog.bz2
Attachment incident-2009-02-27-215731-aj5o5ti.flog.bz2 (38710 bytes) added
Attachment KeyError.html (11258 bytes) added
Attachment incident-2009-03-04-115318-ebt4x5a.flog.bz2 (48415 bytes) added
We recently saw evidence of MemoryError exceptions on many of the testgrid
nodes. These sorts of errors are always annoying, because they usually
interfere with the error-handling code too (and it frequently causes some
operations to fail but others to succeed). I also saw large VmSize values
for many of these nodes. It appears that something caused the nodes to use a
lot of memory (maybe quickly, maybe slowly), eventually causing memory
problems for those nodes or for the other ones that share a host.
I think that this caused some number of storage server requests to fail. I
think that this triggered #546-style problems.
I think that at some point, bs3c1 was the only functioning node that your
client was connected to, which is why it ended up with so many shares. It
might have been connected to the others but they were not accepting writes
because of the memory problems, or it might not have been connected to them
at all.
I still don't understand your second check results (the one that starts with
"Unrecoverable Versions: 2seq20-qb3p"). Is it possible that you checked the
wrong object? That check shows seq20 on bs3c4, but then the third check you
did (which shows 8seq1128/3seq1122/8seq1129) shows seq1128 on that very
same server.
The KeyError is a bug in mutable-retrieve: the
self.remaining_sharemap
table is updated (in
get_data
) while it is being iterated over. I'veopened #667 for this. I suspect the bug is triggered by the mutable-retrieve
process running out of shares during download, but it should be reported
differently.
I think I might have reported check results from different objects. I was doing deep-checks on the directory which contains three different objects, and I might have cut and pasted check results from different objects.
What do we do about this ticket? I don't know how to reproduce the original problem -- ~MemoryErrors due to unknown causes. Brian, did you fix the {{KeyError}}} which was "a bug in
mutable-retrieve
?I think we should either close this ticket as something horrible like "
wontfix
" or else leave it open in the hopes that someone will stumble upon a reproducibleMemoryError
in exactly the same way that caused this error.Or, actually, I guess I would be satisfied if we could change the code so that future
MemoryErrors
would result in quick, clean, loud failures. Maybe change the name of this ticket to "handle MemoryError quickly, cleanly, and loudly"?nope, #667 is still open. I haven't gotten to look at it yet.
I guess I'd recommend changing this ticket to be specifically about
MemoryError
, although I must admit I don't know how we can really fix it.renaming this to "handle MemoryError by failing quickly and loudly" and putting it into Milestone "undecided"
errors on directory write: UncoordinatedWriteError, KeyErrorto handle MemoryError by failing quickly and loudlyPeople are reporting UncoordinatedWriteErrors on the test grid (#748), and so I checked some of the test grid storage servers and saw that one -- tahoebs5.allmydata.com bs5c1 -- has 1.5 GB of virt, 475 MB res. That is running some very old versions of foolscap and TahoeLAFS:
Hm... Yep, that one has MemoryError in its twisted.log. I wonder if we could monkeypatch Python's MemoryError class to do a
sys.exit()
or the like. I suppose this also suggests that we ought to be pushing this issue upstream to Python itself...See also #529 (Implement Halt and Catch Fire)
nejucomo says
setrlimit(2)
to the rescue. We couldsetrlimit(2)
, at least on Unix, to ask the operating system to please kill us if we try to use up too much RAM.