[tahoe-lafs-trac-stream] [tahoe-lafs] #1429: automatically upload a file when it is put in a given local directory
tahoe-lafs
trac at tahoe-lafs.org
Mon Aug 1 11:54:17 PDT 2011
#1429: automatically upload a file when it is put in a given local directory
-------------------------+-------------------------------------------------
Reporter: | Owner: nejucomo
davidsarah | Status: assigned
Type: | Milestone: 1.9.0
enhancement | Version: 1.8.2
Priority: major | Keywords: drop-upload inotify usability
Component: code- | review-needed
frontend |
Resolution: |
Launchpad Bug: |
-------------------------+-------------------------------------------------
Comment (by davidsarah):
Replying to [comment:22 nejucomo]:
> In the {{{DropUploader}}} constructor there may be a race condition
between:
>
> {{{
> if not self._local_path.isdir():
> raise AssertionError("The drop-upload local path %r was not
an existing directory." % quote_output(local_dir))
> }}}
>
> -and later-
>
> {{{
> self._notifier.watch(self._local_path, mask=mask,
callbacks=[self._notify])
> }}}
>
> What happens if {{{self._local_path}}} is deleted between these lines?
If the directory doesn't exist, the call to {{{watch}}} seems to succeed
but not work as intended (even if the directory is later created).
Similarly if the path points to a file rather than a directory. So the
{{{isdir()}}} check is necessary for proper error reporting. In general I
agree that it is "Better To Ask Forgiveness Than Permission" as opposed to
"Looking Before You Leap", but it doesn't seem to be possible to do that
here.
There is no security problem if the directory is deleted, that will just
cause there to be no further notifications.
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1429#comment:23>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list