#2559 closed defect (fixed)

Magic Folder on Windows: make subdirectories work

Reported by: daira Owned by: daira
Priority: normal Milestone: 1.12.0
Component: code-frontend-magic-folder Version: 1.11.0
Keywords: windows otf-magic-folder-objective6 Cc: meejah, dawuud
Launchpad Bug:

Description

It appears that the uploader does get notified about the subdirectory creation, but then hits an assertion when trying to upload it:

01:02:59.710 L20 []#366054 Magic Folder 'alice' uploader: inotify event None, FilePath(u'\\\\?\\D:\\local\\alice\\test'), 'modify, attrib'

01:02:59.710 L20 []#366055 Magic Folder 'alice' uploader: _get_relpath(FilePath(u'\\\\?\\D:\\local\\alice\\test'))
01:02:59.711 L20 []#366056 Magic Folder 'alice' uploader: segments = [u'test']
01:02:59.713 L20 []#366057 Magic Folder 'alice' uploader: _append_to_deque(u'test')
01:02:59.713 L20 []#366058 Magic Folder 'alice' uploader: objects_queued += 1
01:02:59.730 L20 []#366059 Magic Folder 'alice' uploader: _turn_deque
01:02:59.733 L20 []#366060 Magic Folder 'alice' uploader: popped u'test'
01:02:59.733 L20 []#366061 Magic Folder 'alice' uploader: objects_queued += -1
01:02:59.733 L20 []#366062 Magic Folder 'alice' uploader: _process(u'test')
01:02:59.733 L20 []#366063 Magic Folder 'alice' uploader: pending = set([u'test']), about to remove u'test'
01:02:59.734 L20 []#366064 Magic Folder 'alice' uploader: objects_failed += 1
01:02:59.734 L20 []#366065 Magic Folder 'alice' uploader: <twisted.python.failure.Failure <type 'exceptions.AssertionError'>> while processing u'test'
01:02:59.782 L20 []#366066 Magic Folder 'alice' uploader: _turn_deque
01:02:59.782 L20 []#366067 Magic Folder 'alice' uploader: deque is now empty

Change History (9)

comment:1 Changed at 2015-10-30T01:08:01Z by daira

The next step is to improve error reporting of assertions in the uploader.

comment:2 Changed at 2015-10-30T01:27:35Z by daira

Aha!

01:39:03.246 L20 []#759 Magic Folder 'alice' uploader:
[Failure instance: Traceback: <type 'exceptions.AssertionError'>:
precondition: 'watch() can only be called before startReading()'
<type 'str'>, state: 'STARTED' type 'str'>
d:\tahoe\git\tahoe-magic\src\allmydata\frontends\magic_folder.py:169:<lambda>
d:\tahoe\git\tahoe-magic\src\allmydata\frontends\magic_folder.py:402:_process
C:\Python27\lib\site-packages\twisted\internet\defer.py:317:addCallback
C:\Python27\lib\site-packages\twisted\internet\defer.py:306:addCallbacks
--- <exception caught here> ---
C:\Python27\lib\site-packages\twisted\internet\defer.py:588:_runCallbacks
d:\tahoe\git\tahoe-magic\src\allmydata\frontends\magic_folder.py:354:_maybe_upload
d:\tahoe\git\tahoe-magic\src\allmydata\windows\inotify.py:222:watch
d:\tahoe\git\tahoe-magic\src\allmydata\util\assertutil.py:39:precondition
] while processing u'test5'
Last edited at 2015-10-30T01:41:27Z by daira (previous) (diff)

comment:3 Changed at 2015-10-30T01:28:38Z by daira

This happens because the Uploader thinks that it must add watches for new subdirectories, which is true on Linux but not on Windows.

comment:4 Changed at 2015-10-30T02:10:05Z by daira

This seems to be fixed by https://github.com/tahoe-lafs/tahoe-lafs/commit/14097eec7eb94a6418be94c4306c5469c8fa9644, although there's still some odd behaviour in the Downloader (it seems to be trying to repeatedly create directories even when it should know from its magic folder db that they already exist).

comment:5 follow-up: Changed at 2015-10-31T20:25:28Z by daira

Currently subdirectory watches are added with recursive=True. I'm not sure whether this will result in duplicate events being delivered if a watch for a directory is added twice.

Last edited at 2015-11-04T00:10:12Z by daira (previous) (diff)

comment:6 in reply to: ↑ 5 Changed at 2015-10-31T20:34:38Z by daira

Replying to daira:

Currently subdirectory watches are added with recursive=True. I'm not sure whether this will result in duplicate events being delivered if a watch for a directory is added twice.

Actually that's not a problem because Twisted ignores duplicate watch requests. It's also necessary for the case where an existing directory is moved into a monitored one, so that there would otherwise be no notifications for its subdirectories.

Last edited at 2015-11-04T00:10:02Z by daira (previous) (diff)

comment:7 Changed at 2016-07-21T21:32:36Z by Brian Warner <warner@…>

In ea14b1b/trunk:

Don't add subdirectory watches if the platform's notifier doesn't require them. refs #2559

Signed-off-by: Daira Hopwood <daira@…>

comment:8 Changed at 2016-09-29T14:34:34Z by daira

  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from 1.10.1 to 1.11.0

This works and should have been closed.

comment:9 Changed at 2016-09-29T16:52:30Z by warner

  • Milestone changed from undecided to 1.12.0
Note: See TracTickets for help on using tickets.