Skip to content

Set stall timeout from swell launch#772

Open
mranst wants to merge 7 commits intodevelopfrom
feature/mranst/stall_timeout
Open

Set stall timeout from swell launch#772
mranst wants to merge 7 commits intodevelopfrom
feature/mranst/stall_timeout

Conversation

@mranst
Copy link
Copy Markdown
Collaborator

@mranst mranst commented Apr 21, 2026

@rtodling This pr adds the flag '-t` to the swell launch command to dynamically set the cylc stall timeout.

swell launch <experiment> -b -t PT30S

The launch timeout is usually set to an hour by default, or to the value under ~/.cylc/flow/global.cylc. This allows the user to set it manually, intended mostly for the purpose of throwing an error immediately after the suite fails. The implementation here is not ideal, but this will be made simpler in #656.

Comment thread src/swell/deployment/create_experiment.py Outdated
Copy link
Copy Markdown
Collaborator

@shiklomanov-an shiklomanov-an left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable = "unset" thing is an anti-pattern, and cuts off the ability to set this directly via environment variable (which seems useful to preserve). But otherwise, this looks good — happy to approve once that's resolved.

Comment thread src/swell/deployment/create_experiment.py Outdated
Comment on lines +56 to +59
if self.cylc_timeout is not None:
os.environ['SWELL_CYLC_TIMEOUT'] = self.cylc_timeout
else:
os.environ['SWELL_CYLC_TIMEOUT'] = 'unset'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things:

  1. Per my comment above, setting the variable to "unset" is an anti-pattern. I would just leave the variable literally unset.
        if self.cylc_timeout is not None:
            os.environ['SWELL_CYLC_TIMEOUT'] = self.cylc_timeout
        # no else
  1. Do you want to give users the ability to control this directly via environment variable? Might come in handy for certain edge cases. If so, consider leaving any user-specified values of SELF_CYLC_TIMEOUT unchanged.
        if self.cylc_timeout and 'SELF_CYLC_TIMEOUT' not in os.environ:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks. As for 2, the way it is currently a user would have to go out of their way to specify -t, so I think it would be best to allow that to override the environment variable, so the hierarchy of control would be (in ascending order)

  1. Cylc default
  2. Value in global.cylc
  3. User-set environment variable
  4. User-specified value on command line

Comment thread src/swell/suites/3dfgat_atmos/flow.cylc
@mranst mranst requested a review from shiklomanov-an May 8, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants