code: async def _reset_protocol(self, exc=None):
          
          # Be responsible and clean up.
          protocol = await self._get_protocol()
          await protocol.shutdown()
          self._protocol = None
          # Let any observers know the protocol has been shutdown.
          for ob_error in self._observations_err_callbacks:
              ob_error(exc)
          self._observations_err_callbacks.clear()
docs: Reset the protocol if an error occurs.