review #1037 (SFTP) #1106
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#1106
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?
Per comment:77205, the patches that fixed #1037 need to be reviewed. I've reviewed about half of them. I'll start posting my notes.
Review notes (the review is not complete)
David-Sarah: overall this is excellent work! It is readable and correct, with a few but not many parts that are un-idiomatic.
Things that need to be responded to:
sftpd.noisy
isTrue
. Is that intentional?# invariant: self.download_size <= self.current_size
self.producer=p in registerProducer()
?TODO: check that clients are okay with this being a "?". (They should be because the longname is intended for human consumption.)
Ideas that don't necessarily need to be responded to:
# TODO: use download interface described in #993 when implemented.
I don't like "TODO" in comments in source code. They aren't usually noticed by the people who need to be reminded, and they often become stale (the thing no longer needs to be done, but nobody thinks to find the TODO and remove it.) I prefer issue tickets. This "TODO" should probably be deleted or moved to an issue ticket or maybe do the thing that it says to do. :-)Replying to zooko:
Yes, at this point the noisy logging is still very useful. It doesn't have much of a performance impact I think, so I might just
s/if noisy: //g
.The invariant is documenting that this condition is always true. That it's true at that point (actually, made true by the next two lines) is fairly obvious -- so I'm not sure an
assert
would really help, but I don't object to adding one.No. According to the twisted API docs, a
RuntimeError
should be raised if a producer is already registered. I'll fix that.It is. Why is this bad? The synchronous alternative would be:
which is worse wrt potentially starving concurrent activities (but that is what Twisted does in some of its consumers, and we do it in source:src/allmydata/util/consumer.py).
No, see the doc comment for
GeneralSFTPFile
:(There should be a similar comment for
ShortReadOnlySFTPFile
.) Is this unclear?Will do.
Oh, so it is. I was not aware of that aspect of Python slicing semantics (maybe because we would have made it raise an error ;-)
traceback.format_exc
was in practice raising exceptions in obscure cases (I think related to implicit unicode<->str conversion, but I forget the details). Rather than trying to make sure that it never raises an exception, I decided to suppress them. The traceback is very useful for debugging when it does get logged, so I'm loath to remove this code.In case we are running over Tor or I2P, we shouldn't reveal information that would identify the node, as discussed in #1008.
Agreed.
Yes, absolutely. It's difficult to test because it depends on the ordering of reads and overwrites relative to writes coming from the producer, but that could be made deterministic by using a custom test producer.
It is indeed defined by IFinishableConsumer. I'll add a docstring.
It is documented in /tahoe-lafs/trac-2024-07-25/issues/6055#comment:5, so I'll remove the TODO.
They do. (They didn't in a previous version, where I had extra logging in
eventually_callback
, but that's not needed any more.) I will simplify the Schönfinkel'd calls.Will do (but first the tests will need to be changed to not be dependent on SIZE_THRESHOLD being 1000).
Attachment sftp-comments.dpatch (10082 bytes) added
SFTP: address some of the comments in zooko's review (#1106).
Attachment sftp-no-trunc-files-opened-with-append.dpatch (4012 bytes) added
SFTP: refuse to truncate files opened with FXF_APPEND (see /tahoe-lafs/trac-2024-07-25/issues/6099#comment:20).
sftp-comments.dpatch looks good.
re: sftp-no-trunc-files-opened-with-append.dpatch : should we add a unit test?
Replying to zooko:
This patch caused a regression in test_openFile_write. It needs more work.
sftp-comments.dpatch was applied in changeset:15ddab08edebd7fe.