ZeroDivisionError in web/status.py #1166
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
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1166
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?
(http://tahoe-lafs.org/buildbot/builders/FreeStorm%20WinXP-x86%20py2.6/builds/252/steps/test/logs/stdio)
Looks like
segtime
was zero because something took less time than the clock granularity.Attachment 1166-zerodiv.diff (1437 bytes) added
avoid divide-by-zero. Windows, how I hate thee.
Oh come on, you can't blame Windows! "I will tick my clock faster than you do anything you care about." is not part of the contract that we choose to rely on. Also note that even after attachment:1166-zerodiv.diff, when
rtt > 0
butrtt <= ϵ
then thespeed
measurement will be wildly inaccurate.ok, ok.
Needs tests anyways: test_web should acquire a second
DownloadStatus
instance in itsFakeHistory
object (with zero durations), andWeb.test_status
should make sure it renders without exception.I don't know what to suggest about very small durations and very large speed measurements. Since the duration is clearly visible next to the speed, I believe users will figure it out for themselves ("huh, 18 terabytes per second? oh, look, and the whole thing completed in one microsecond. maybe that's not very accurate").
Maybe we should change the common
abbreviate_rate
function to take(bytes, seconds)
arguments and have it do the division (and zero-avoidance) in one central place.Replying to warner:
+1.
(Brian and Zooko are both right: we shouldn't rely on the clock ticking fast enough, but Windows' clock ticks stupidly slowly.)
Is this important enough to fix in 1.8.0?
Looks like an easy ticket, I'll give it a go.
Attachment rate-computation-refactoring.dpatch (7496 bytes) added
The attached patch contains a test case for this specific bug and a complete refactoring of rate computation on the status page.
Replying to warner:
This is implemented in a new function
compute_rate
. It sounds cleaner to me, becauseabbreviate_rate
is called (viarender_rate
) from Nevow templates which only pass a singledata
argument. Moreover, this allows the function to be used more often inweb/status.py
.wait, what's that
0.1
doing in there? If it said1.0
, and if the tests were updated to match, I'd be +1 on this patch.Replying to warner:
Oh crap! Can't believe how I missed that. Thanks for spotting it!
This is probably an indication that tests were not thorough enough, so I added a new human understandable one.
Attachment rate-computation-refactoring-2.dpatch (7633 bytes) added
looks good to me.
terrell reviewed it so I'm removing the
review-needed
and addingreviewed
.In changeset:f026927f86584870: