Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3349

Don't clear entire load balanced pool when serviceId is unknown

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.2
    • Affects Version/s: None
    • Component/s: None
    • None

      From Slack conversation with Matt Dale about the load balancer spec:

      In the specific case of errors during handshake for load balanced topologies, the single pool (pools are created per server, so load balanced topologies have a single pool) is logically separated into groups of connections using the "service ID". If we don't know the service ID yet (because the first step of the handshake failed), clearing the pool with a null service ID will either have no effect or an undesirable effect, so there's not much we can do. Once we have a service ID (after the first step of the handshake succeeds), we know enough to clear only the connections associated with that service ID.

       [2022/06/08 02:54:46.758] FAIL [0.107s]: test_errors_during_the_initial_connection_hello_are_ignored (test_load_balancer.TestLoadBalancerSdamErrorHandling)
       [2022/06/08 02:54:46.758] ----------------------------------------------------------------------
       [2022/06/08 02:54:46.758] Traceback (most recent call last):
       [2022/06/08 02:54:46.758]   File "/data/mci/b93e5e8afe8b663e2f1c7d4a2323ab12/src/test/unified_format.py", line 1277, in test_case
       [2022/06/08 02:54:46.758]     self.run_scenario(spec)
       [2022/06/08 02:54:46.758]   File "/data/mci/b93e5e8afe8b663e2f1c7d4a2323ab12/src/test/unified_format.py", line 1260, in run_scenario
       [2022/06/08 02:54:46.758]     self.check_events(expect_events)
       [2022/06/08 02:54:46.758]   File "/data/mci/b93e5e8afe8b663e2f1c7d4a2323ab12/src/test/unified_format.py", line 1205, in check_events
       [2022/06/08 02:54:46.758]     self.assertEqual(len(actual_events), len(events), actual_events)
       [2022/06/08 02:54:46.758] AssertionError: 4 != 3 : [ConnectionCreatedEvent(('127.0.0.1', 8000), 1), ConnectionClosedEvent(('127.0.0.1', 8000), 1, 'error'), ConnectionCheckOutFailedEvent(('127.0.0.1', 8000), 'connectionError'), PoolClearedEvent(('127.0.0.1', 8000), None)]
      

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: