Poll SRV records for a seedlist. Returns a list of ServerDescriptions.
(self)
| 409 | await self.close() |
| 410 | |
| 411 | async def _get_seedlist(self) -> Optional[list[tuple[str, Any]]]: |
| 412 | """Poll SRV records for a seedlist. |
| 413 | |
| 414 | Returns a list of ServerDescriptions. |
| 415 | """ |
| 416 | try: |
| 417 | resolver = _SrvResolver( |
| 418 | self._fqdn, |
| 419 | self._settings.pool_options.connect_timeout, |
| 420 | self._settings.srv_service_name, |
| 421 | ) |
| 422 | seedlist, ttl = await resolver.get_hosts_and_min_ttl() |
| 423 | if len(seedlist) == 0: |
| 424 | # As per the spec: this should be treated as a failure. |
| 425 | raise Exception |
| 426 | except Exception as exc: |
| 427 | # As per the spec, upon encountering an error: |
| 428 | # - An error must not be raised |
| 429 | # - SRV records must be rescanned every heartbeatFrequencyMS |
| 430 | # - Topology must be left unchanged |
| 431 | self.request_check() |
| 432 | _debug_log(_SDAM_LOGGER, message="SRV monitor check failed", failure=repr(exc)) |
| 433 | return None |
| 434 | else: |
| 435 | self._executor.update_interval(max(ttl, common.MIN_SRV_RESCAN_INTERVAL)) |
| 436 | return seedlist |
| 437 | |
| 438 | |
| 439 | class _RttMonitor(MonitorBase): |
no test coverage detected