diff --git a/wandb/sdk/internal/system/assets/interfaces.py b/wandb/sdk/internal/system/assets/interfaces.py index 74062d0030e..bfb33f51865 100644 --- a/wandb/sdk/internal/system/assets/interfaces.py +++ b/wandb/sdk/internal/system/assets/interfaces.py @@ -168,7 +168,11 @@ def start(self) -> None: logger.info(f"Started {self._process.name}") def finish(self) -> None: - if self._process is not None: + if self._process is None: + return None + try: self._process.join() logger.info(f"Joined {self._process.name}") - self._process = None + except Exception as e: + logger.warning(f"Failed to join {self._process.name}: {e}") + self._process = None diff --git a/wandb/sdk/internal/system/system_monitor.py b/wandb/sdk/internal/system/system_monitor.py index 81082f551c1..5d856ec4d19 100644 --- a/wandb/sdk/internal/system/system_monitor.py +++ b/wandb/sdk/internal/system/system_monitor.py @@ -161,7 +161,10 @@ def finish(self) -> None: self._shutdown_event.set() for asset in self.assets: asset.finish() - self._process.join() + try: + self._process.join() + except Exception as e: + logger.error(f"Error joining system monitor process: {e}") self._process = None def probe(self, publish: bool = True) -> None: diff --git a/wandb/sdk/lib/git.py b/wandb/sdk/lib/git.py index 7b1a3117653..13ecc2964ed 100644 --- a/wandb/sdk/lib/git.py +++ b/wandb/sdk/lib/git.py @@ -62,7 +62,12 @@ def enabled(self) -> bool: def root(self) -> Optional[str]: if not self.repo: return None - return self.repo.git.rev_parse("--show-toplevel") + try: + return self.repo.git.rev_parse("--show-toplevel") + except exc.GitCommandError as e: + # todo: collect telemetry on this + logger.error(f"git root error: {e}") + return None @property def dirty(self) -> bool: diff --git a/wandb/sdk/wandb_settings.py b/wandb/sdk/wandb_settings.py index 9b059d2a8bd..5e8a37a0dbc 100644 --- a/wandb/sdk/wandb_settings.py +++ b/wandb/sdk/wandb_settings.py @@ -1008,7 +1008,7 @@ def __init__(self, **kwargs: Any) -> None: self.__unexpected_args: Set[str] = set() # Set default settings values - # We start off with the class attributes and `default_props`' dicts + # We start off with the class attributes and `default_props` dicts # and then create Property objects. # Once initialized, attributes are to only be updated using the `update` method default_props = self._default_props()