stop creating a control tub for client nodes

This commit is contained in:
Jean-Paul Calderone
2021-10-15 12:02:24 -04:00
parent 95b765e309
commit e0312eae57
2 changed files with 1 additions and 29 deletions

View File

@ -40,7 +40,6 @@ from allmydata.storage.server import StorageServer
from allmydata import storage_client from allmydata import storage_client
from allmydata.immutable.upload import Uploader from allmydata.immutable.upload import Uploader
from allmydata.immutable.offloaded import Helper from allmydata.immutable.offloaded import Helper
from allmydata.control import ControlServer
from allmydata.introducer.client import IntroducerClient from allmydata.introducer.client import IntroducerClient
from allmydata.util import ( from allmydata.util import (
hashutil, base32, pollmixin, log, idlib, hashutil, base32, pollmixin, log, idlib,
@ -283,7 +282,7 @@ def create_client_from_config(config, _client_factory=None, _introducer_factory=
config, tub_options, default_connection_handlers, config, tub_options, default_connection_handlers,
foolscap_connection_handlers, i2p_provider, tor_provider, foolscap_connection_handlers, i2p_provider, tor_provider,
) )
control_tub = node.create_control_tub() control_tub = None
introducer_clients = create_introducer_clients(config, main_tub, _introducer_factory) introducer_clients = create_introducer_clients(config, main_tub, _introducer_factory)
storage_broker = create_storage_farm_broker( storage_broker = create_storage_farm_broker(
@ -648,7 +647,6 @@ class _Client(node.Node, pollmixin.PollMixin):
self.init_stats_provider() self.init_stats_provider()
self.init_secrets() self.init_secrets()
self.init_node_key() self.init_node_key()
self.init_control()
self._key_generator = KeyGenerator() self._key_generator = KeyGenerator()
key_gen_furl = config.get_config("client", "key_generator.furl", None) key_gen_furl = config.get_config("client", "key_generator.furl", None)
if key_gen_furl: if key_gen_furl:
@ -985,12 +983,6 @@ class _Client(node.Node, pollmixin.PollMixin):
def get_history(self): def get_history(self):
return self.history return self.history
def init_control(self):
c = ControlServer()
c.setServiceParent(self)
control_url = self.control_tub.registerReference(c)
self.config.write_private_config("control.furl", control_url + "\n")
def init_helper(self): def init_helper(self):
self.helper = Helper(self.config.get_config_path("helper"), self.helper = Helper(self.config.get_config_path("helper"),
self.storage_broker, self._secret_holder, self.storage_broker, self._secret_holder,

View File

@ -780,7 +780,6 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
d.addCallback(self._check_publish_private) d.addCallback(self._check_publish_private)
d.addCallback(self.log, "did _check_publish_private") d.addCallback(self.log, "did _check_publish_private")
d.addCallback(self._test_web) d.addCallback(self._test_web)
d.addCallback(self._test_control)
d.addCallback(self._test_cli) d.addCallback(self._test_cli)
# P now has four top-level children: # P now has four top-level children:
# P/personal/sekrit data # P/personal/sekrit data
@ -1343,25 +1342,6 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
if line.startswith("CHK %s " % storage_index_s)] if line.startswith("CHK %s " % storage_index_s)]
self.failUnlessEqual(len(matching), 10) self.failUnlessEqual(len(matching), 10)
def _test_control(self, res):
# exercise the remote-control-the-client foolscap interfaces in
# allmydata.control (mostly used for performance tests)
c0 = self.clients[0]
control_furl_file = c0.config.get_private_path("control.furl")
control_furl = ensure_str(open(control_furl_file, "r").read().strip())
# it doesn't really matter which Tub we use to connect to the client,
# so let's just use our IntroducerNode's
d = self.introducer.tub.getReference(control_furl)
d.addCallback(self._test_control2, control_furl_file)
return d
def _test_control2(self, rref, filename):
d = defer.succeed(None)
d.addCallback(lambda res: rref.callRemote("speed_test", 1, 200, False))
if sys.platform in ("linux2", "linux3"):
d.addCallback(lambda res: rref.callRemote("get_memory_usage"))
d.addCallback(lambda res: rref.callRemote("measure_peer_response_time"))
return d
def _test_cli(self, res): def _test_cli(self, res):
# run various CLI commands (in a thread, since they use blocking # run various CLI commands (in a thread, since they use blocking
# network calls) # network calls)