Changeset 84dfb36 in trunk


Ignore:
Timestamp:
2021-10-26T00:57:23Z (3 years ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
2336cae7, 28cc3ca, dd29efc, f02f14a
Parents:
211640a (diff), ad216e0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jean-Paul Calderone <exarkun@…> (2021-10-26 00:57:23)
git-committer:
GitHub <noreply@…> (2021-10-26 00:57:23)
Message:

Merge pull request #1141 from LeastAuthority?/3814.remove-control-port

Remove the "control port" and its associated Tub

Fixes: ticket:3814

Files:
1 added
4 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified .gitignore

    r211640a r84dfb36  
    3131/src/allmydata/test/plugins/dropin.cache
    3232/_trial_temp*
    33 /_test_memory/
    3433/tmp*
    3534/*.patch
  • TabularUnified Makefile

    r211640a r84dfb36  
    143143
    144144
    145 # The check-speed and check-grid targets are disabled, since they depend upon
    146 # the pre-located $(TAHOE) executable that was removed when we switched to
    147 # tox. They will eventually be resurrected as dedicated tox environments.
    148 
    149 # The check-speed target uses a pre-established client node to run a canned
    150 # set of performance tests against a test network that is also
    151 # pre-established (probably on a remote machine). Provide it with the path to
    152 # a local directory where this client node has been created (and populated
    153 # with the necessary FURLs of the test network). This target will start that
    154 # client with the current code and then run the tests. Afterwards it will
    155 # stop the client.
    156 #
    157 # The 'sleep 5' is in there to give the new client a chance to connect to its
    158 # storageservers, since check_speed.py has no good way of doing that itself.
    159 
    160 ##.PHONY: check-speed
    161 ##check-speed: .built
    162 ##      if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
    163 ##      @echo "stopping any leftover client code"
    164 ##      -$(TAHOE) stop $(TESTCLIENTDIR)
    165 ##      $(TAHOE) start $(TESTCLIENTDIR)
    166 ##      sleep 5
    167 ##      $(TAHOE) @src/allmydata/test/check_speed.py $(TESTCLIENTDIR)
    168 ##      $(TAHOE) stop $(TESTCLIENTDIR)
    169 
    170145# The check-grid target also uses a pre-established client node, along with a
    171146# long-term directory that contains some well-known files. See the docstring
     
    196171.PHONY: clean
    197172clean:
    198         rm -rf build _trial_temp _test_memory .built
     173        rm -rf build _trial_temp .built
    199174        rm -f `find src *.egg -name '*.so' -or -name '*.pyc'`
    200175        rm -rf support dist
    201176        rm -rf `ls -d *.egg | grep -vEe"setuptools-|setuptools_darcs-|darcsver-"`
    202177        rm -rf *.pyc
    203         rm -f bin/tahoe bin/tahoe.pyscript
    204178        rm -f *.pkg
    205179
  • TabularUnified src/allmydata/client.py

    r211640a r84dfb36  
    4141from allmydata.immutable.upload import Uploader
    4242from allmydata.immutable.offloaded import Helper
    43 from allmydata.control import ControlServer
    4443from allmydata.introducer.client import IntroducerClient
    4544from allmydata.util import (
     
    284283        foolscap_connection_handlers, i2p_provider, tor_provider,
    285284    )
    286     control_tub = node.create_control_tub()
    287285
    288286    introducer_clients = create_introducer_clients(config, main_tub, _introducer_factory)
     
    295293        config,
    296294        main_tub,
    297         control_tub,
    298295        i2p_provider,
    299296        tor_provider,
     
    632629                                   }
    633630
    634     def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider, introducer_clients,
     631    def __init__(self, config, main_tub, i2p_provider, tor_provider, introducer_clients,
    635632                 storage_farm_broker):
    636633        """
    637634        Use :func:`allmydata.client.create_client` to instantiate one of these.
    638635        """
    639         node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
     636        node.Node.__init__(self, config, main_tub, i2p_provider, tor_provider)
    640637
    641638        self.started_timestamp = time.time()
     
    649646        self.init_secrets()
    650647        self.init_node_key()
    651         self.init_control()
    652648        self._key_generator = KeyGenerator()
    653649        key_gen_furl = config.get_config("client", "key_generator.furl", None)
     
    986982        return self.history
    987983
    988     def init_control(self):
    989         c = ControlServer()
    990         c.setServiceParent(self)
    991         control_url = self.control_tub.registerReference(c)
    992         self.config.write_private_config("control.furl", control_url + "\n")
    993 
    994984    def init_helper(self):
    995985        self.helper = Helper(self.config.get_config_path("helper"),
  • TabularUnified src/allmydata/introducer/server.py

    r211640a r84dfb36  
    4040from allmydata.node import create_node_dir
    4141from allmydata.node import create_connection_handlers
    42 from allmydata.node import create_control_tub
    4342from allmydata.node import create_tub_options
    4443from allmydata.node import create_main_tub
     
    8988            foolscap_connection_handlers, i2p_provider, tor_provider,
    9089        )
    91         control_tub = create_control_tub()
    9290
    9391        node = _IntroducerNode(
    9492            config,
    9593            main_tub,
    96             control_tub,
    9794            i2p_provider,
    9895            tor_provider,
     
    106103    NODETYPE = "introducer"
    107104
    108     def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider):
    109         node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
     105    def __init__(self, config, main_tub, i2p_provider, tor_provider):
     106        node.Node.__init__(self, config, main_tub, i2p_provider, tor_provider)
    110107        self.init_introducer()
    111108        webport = self.get_config("node", "web.port", None)
  • TabularUnified src/allmydata/node.py

    r211640a r84dfb36  
    920920
    921921
    922 def create_control_tub():
    923     """
    924     Creates a Foolscap Tub for use by the control port. This is a
    925     localhost-only ephemeral Tub, with no control over the listening
    926     port or location
    927     """
    928     control_tub = Tub()
    929     portnum = iputil.listenOnUnused(control_tub)
    930     log.msg("Control Tub location set to 127.0.0.1:%s" % (portnum,))
    931     return control_tub
    932 
    933 
    934922class Node(service.MultiService):
    935923    """
     
    939927    CERTFILE = "node.pem"
    940928
    941     def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider):
     929    def __init__(self, config, main_tub, i2p_provider, tor_provider):
    942930        """
    943931        Initialize the node with the given configuration. Its base directory
     
    967955        else:
    968956            self.nodeid = self.short_nodeid = None
    969 
    970         self.control_tub = control_tub
    971         if self.control_tub is not None:
    972             self.control_tub.setServiceParent(self)
    973957
    974958        self.log("Node constructed. " + __full_version__)
  • TabularUnified src/allmydata/test/no_network.py

    r211640a r84dfb36  
    1818# This should be useful for tests which want to examine and/or manipulate the
    1919# uploaded shares, checker/verifier/repairer tests, etc. The clients have no
    20 # Tubs, so it is not useful for tests that involve a Helper or the
    21 # control.furl .
     20# Tubs, so it is not useful for tests that involve a Helper.
    2221
    2322from future.utils import PY2
     
    252251        config,
    253252        main_tub=None,
    254         control_tub=None,
    255253        i2p_provider=None,
    256254        tor_provider=None,
     
    275273    def init_introducer_client(self):
    276274        pass
    277     def create_control_tub(self):
    278         pass
    279275    def create_log_tub(self):
    280276        pass
     
    285281    def stopService(self):
    286282        return service.MultiService.stopService(self)
    287     def init_control(self):
    288         pass
    289283    def init_helper(self):
    290284        pass
  • TabularUnified src/allmydata/test/test_system.py

    r211640a r84dfb36  
    1313
    1414from past.builtins import chr as byteschr, long
    15 from six import ensure_text, ensure_str
     15from six import ensure_text
    1616
    1717import os, re, sys, time, json
     
    781781        d.addCallback(self.log, "did _check_publish_private")
    782782        d.addCallback(self._test_web)
    783         d.addCallback(self._test_control)
    784783        d.addCallback(self._test_cli)
    785784        # P now has four top-level children:
     
    13441343        self.failUnlessEqual(len(matching), 10)
    13451344
    1346     def _test_control(self, res):
    1347         # exercise the remote-control-the-client foolscap interfaces in
    1348         # allmydata.control (mostly used for performance tests)
    1349         c0 = self.clients[0]
    1350         control_furl_file = c0.config.get_private_path("control.furl")
    1351         control_furl = ensure_str(open(control_furl_file, "r").read().strip())
    1352         # it doesn't really matter which Tub we use to connect to the client,
    1353         # so let's just use our IntroducerNode's
    1354         d = self.introducer.tub.getReference(control_furl)
    1355         d.addCallback(self._test_control2, control_furl_file)
    1356         return d
    1357     def _test_control2(self, rref, filename):
    1358         d = defer.succeed(None)
    1359         d.addCallback(lambda res: rref.callRemote("speed_test", 1, 200, False))
    1360         if sys.platform in ("linux2", "linux3"):
    1361             d.addCallback(lambda res: rref.callRemote("get_memory_usage"))
    1362         d.addCallback(lambda res: rref.callRemote("measure_peer_response_time"))
    1363         return d
    1364 
    13651345    def _test_cli(self, res):
    13661346        # run various CLI commands (in a thread, since they use blocking
  • TabularUnified src/allmydata/test/web/test_introducer.py

    r211640a r84dfb36  
    212212        main_tub.listenOn(b"tcp:0")
    213213        main_tub.setLocation(b"tcp:127.0.0.1:1")
    214         introducer_node = _IntroducerNode(config, main_tub, None, None, None)
     214        introducer_node = _IntroducerNode(config, main_tub, None, None)
    215215
    216216        introducer_service = introducer_node.getServiceNamed("introducer")
  • TabularUnified tox.ini

    r211640a r84dfb36  
    207207         python misc/build_helpers/run-deprecations.py --package allmydata --warnings={env:TAHOE_LAFS_WARNINGS_LOG:_trial_temp/deprecation-warnings.log} trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata}
    208208
    209 [testenv:checkmemory]
    210 commands =
    211          rm -rf _test_memory
    212          python src/allmydata/test/check_memory.py upload
    213          python src/allmydata/test/check_memory.py upload-self
    214          python src/allmydata/test/check_memory.py upload-POST
    215          python src/allmydata/test/check_memory.py download
    216          python src/allmydata/test/check_memory.py download-GET
    217          python src/allmydata/test/check_memory.py download-GET-slow
    218          python src/allmydata/test/check_memory.py receive
    219 
    220209# Use 'tox -e docs' to check formatting and cross-references in docs .rst
    221210# files. The published docs are built by code run over at readthedocs.org,
Note: See TracChangeset for help on using the changeset viewer.