class_docstr: A rendezvous implementation that uses `etcd <https://etcd.io/>`__ as the backend store.
class_docstr_tok: ["A","rendezvous","implementation","that","uses","`","etcd","<","https",":","\/\/etcd.io\/",">","`","__","as","the","backend","store","."]
docstr: Handle the case when there's an existing (state 'final) rendezvous already
  in place, and we have to announce ourselves waiting, and wait until
  the next rendezvous opportunity.
docstr_tok: ["Handle","the","case","when","there","'s","an","existing","(","state","'final",")","rendezvous","already","in","place",",","and","we","have","to","announce","ourselves","waiting",",","and","wait","until","the","next","rendezvous","opportunity","."]
code: def handle_existing_rendezvous(self, expected_version):
      """
      Handle the case when there's an existing (state 'final) rendezvous already
      in place, and we have to announce ourselves waiting, and wait until
      the next rendezvous opportunity.
      """
      # If state is 'final' -> increment num_workers_waiting
      # Then, observe state changes:
      #   1. if it's no longer final -> bail out and re-try
      #   2. if keep alives are missing, destroy it and bail out.
      active_state = self.announce_self_waiting(expected_version)
      log.info(
          "Added self to waiting list. Rendezvous full state: %s",
          active_state.value,
      )
  
      self.wait_for_rendezvous_to_free(expected_version)
      log.info(
          "Previously existing rendezvous state changed. Will re-try joining."
      )
  
imports: import json
  import logging
  import sys
  import threading
  import time
  from typing import Optional
  import etcd
  from torch.distributed.elastic.rendezvous import RendezvousClosedError, RendezvousError, RendezvousHandler, RendezvousParameters, RendezvousTimeoutError
  from .utils import parse_rendezvous_endpoint
  from .etcd_store import EtcdStore, cas_delay
label_desc: Use image node_id 7 for calling the EtcdRendezvous obj's underlying member method code with example usage: obj.handle_existing_rendezvous(expected_version) without return types