Skip to content

Support decimal-second timeout values - #2

Merged
MarkusPaulsen merged 1 commit into
mainfrom
fix/i-090-timeout-units
Sep 8, 2026
Merged

Support decimal-second timeout values#2
MarkusPaulsen merged 1 commit into
mainfrom
fix/i-090-timeout-units

Conversation

@ShudongCai

@ShudongCai ShudongCai commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept existing integer-second timeout values and canonical decimal-second values with millisecond precision
  • pass timeout durations to GNU timeout with an explicit s suffix
  • reject malformed explicit timeout values instead of allowing them to weaken the limit
  • apply the same timeout contract to the modular runtime and the legacy wrapper

Motivation

Ares2 exposes resource timeouts in milliseconds, while Phobos previously treated the serialized integer as seconds. As a result, a timeout such as 2000 milliseconds could be executed as 2000 seconds.

The coordinated Ares2 change serializes millisecond values as canonical decimal seconds:

  • 2000 ms becomes 2.000
  • 1234 ms becomes 1.234
  • 500 ms becomes 0.500

Phobos accepts that representation and passes it to GNU timeout as 2.000s, 1.234s, or 0.500s.

Compatibility

Existing native Phobos configurations using integer seconds remain valid. Zero and absent timeout values preserve their existing disabled behavior. Existing integer values are not heuristically reinterpreted as milliseconds.

Accepted configuration grammar:

^[0-9]+([.][0-9]{3})?$

Verification

  • bash -n core/phobos-common.sh
  • bash -n core/phobos-filesystem.sh
  • bash -n core/phobos_wrapper.sh
  • bash tests/timeout_units.sh
  • git diff --check

Coordinated Ares2 change

The corresponding Ares2 serialization change is:

ls1intum/Ares2#175

The updated Phobos runtime must be available before the coordinated Ares2 behavior is released.

@MarkusPaulsen
MarkusPaulsen merged commit 5d960aa into main Sep 8, 2026
@MarkusPaulsen
MarkusPaulsen deleted the fix/i-090-timeout-units branch September 8, 2026 11:41
@MarkusPaulsen MarkusPaulsen mentioned this pull request Sep 8, 2026
8 tasks
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