|
11 | 11 | import sys
|
12 | 12 | import time
|
13 | 13 | from pathlib import Path
|
14 |
| -from subprocess import SubprocessError |
15 | 14 | from typing import Any
|
16 | 15 | from urllib.parse import parse_qsl, urlparse
|
17 | 16 |
|
@@ -751,41 +750,10 @@ def _start(self) -> None:
|
751 | 750 | ]
|
752 | 751 | cmd.extend(self._set_timeout_variables())
|
753 | 752 | self._logger.debug("Command to run:", command=cmd)
|
754 |
| - # Set environment variable to indicate we are inside JupyterLab |
755 |
| - # (we want the shell to source loadLSST.bash once we are) |
756 |
| - if self._debug: |
757 |
| - # Maybe we want to parameterize these? |
758 |
| - retries = 10 |
759 |
| - sleep_interval = 60 |
760 |
| - for i in range(retries): |
761 |
| - self._logger.debug(f"Lab spawn attempt {i+1}/{retries}:") |
762 |
| - try: |
763 |
| - proc = self._cmd.run(*cmd, env=self._env) |
764 |
| - except SubprocessError as exc: |
765 |
| - self._logger.exception( |
766 |
| - f"Command {cmd} failed to run", exc=exc |
767 |
| - ) |
768 |
| - if proc: |
769 |
| - if proc.returncode: |
770 |
| - self._logger.error( |
771 |
| - f"Lab exited with returncode {proc.returncode}", |
772 |
| - proc=proc, |
773 |
| - ) |
774 |
| - else: |
775 |
| - self._logger.warning( |
776 |
| - "Lab process exited with returncode 0", proc=proc |
777 |
| - ) |
778 |
| - else: |
779 |
| - self._logger.error(f"Lab process {cmd} failed to run") |
780 |
| - self._logger.info(f"Waiting for {sleep_interval}s") |
781 |
| - time.sleep(sleep_interval) |
782 |
| - self._logger.debug("Exiting") |
783 |
| - sys.exit(0) |
784 | 753 | # Flush open files before exec()
|
785 | 754 | sys.stdout.flush()
|
786 | 755 | sys.stderr.flush()
|
787 |
| - # In non-debug mode, we don't use a subprocess: we exec the |
788 |
| - # Jupyter process directly. We use os.execvpe() because we |
789 |
| - # have a list of arguments we just created and we want to |
790 |
| - # pass the environment we built up. |
| 756 | + # exec the Jupyter process directly. We use os.execvpe() |
| 757 | + # because we have a list of arguments we just created and we |
| 758 | + # want to pass the environment we built up. |
791 | 759 | os.execvpe(cmd[0], cmd, env=self._env)
|
0 commit comments