[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3017: MagicFolder.startService is called twice because _Client.init_magic_folder incorrectly calls startService

Tahoe-LAFS trac at tahoe-lafs.org
Thu Mar 28 20:08:23 UTC 2019


#3017: MagicFolder.startService is called twice because _Client.init_magic_folder
incorrectly calls startService
---------------------+---------------------------
 Reporter:  exarkun  |          Owner:
     Type:  defect   |         Status:  new
 Priority:  normal   |      Milestone:  undecided
Component:  unknown  |        Version:  1.12.1
 Keywords:           |  Launchpad Bug:
---------------------+---------------------------
 {{{
 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...

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3017>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list