Opened at 2019-03-28T20:08:23Z
Closed at 2019-04-01T17:01:13Z
#3017 closed defect (fixed)
MagicFolder.startService is called twice because _Client.init_magic_folder incorrectly calls startService
Reported by: | exarkun | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | unknown | Version: | 1.12.1 |
Keywords: | review-needed | Cc: | |
Launchpad Bug: |
Description
diff --git a/src/allmydata/client.py b/src/allmydata/client.py index b6815c3d1..f646ad4e7 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -761,6 +761,7 @@ class _Client(node.Node, pollmixin.PollMixin): s = magic_folder.MagicFolder.from_config(self, name, mf_config) self._magic_folders[name] = s s.setServiceParent(self) + # XXX wrong the parent will start it s.startService() connected_d = self.storage_broker.when_connected_enough(threshold) diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 85b940914..d4cc48592 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -403,6 +403,7 @@ class MagicFolder(service.MultiService): def startService(self): # TODO: why is this being called more than once? + # TODO: Because of the XXX in init_magic_folder in client.py if self.running: return defer.succeed(None) service.MultiService.startService(self)
Just stop calling startService on the magic folder and its lifetime will be managed correctly. Of course, some part of the implementation may have come to _depend_ on the incorrect lifetime management at this point...
Change History (2)
comment:1 Changed at 2019-03-28T20:19:52Z by exarkun
- Keywords review-needed added
comment:2 Changed at 2019-04-01T17:01:13Z by exarkun
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
https://github.com/tahoe-lafs/tahoe-lafs/pull/591