[Feature] Fix auto_clear_time conversion and wait_interval boundary
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in rock/sdk/sandbox/client.py by reading Sandbox.create() and wait_for_process(). Check the auto_clear_time and auto_clear_time_minutes conversions and the polling interval behavior; done means fractional-minute values are rounded up to integers and wait_interval allows a status check before auto-clear.
Written by the indexing model from the issue text.
Description
Feature Category
- Sandbox
- Actions
- Deployments
- SDK & API
- Envhub
- CLI
- Performance & Optimization
- Documentation & Examples
Problem Statement
In Sandbox.create(), auto_clear_time and auto_clear_time_minutes are calculated via plain float division (auto_clear_seconds / 60), which can produce fractional minutes (e.g., 90 seconds → 1.5 minutes). The server-side API expects an integer value in minutes, and a float may cause unexpected truncation or rejection.
Additionally, wait_for_process() does not enforce that wait_interval is smaller than auto_clear_seconds, which can lead to the sandbox being auto-cleared before the next status check happens.
Proposed Solution
- Use
int(math.ceil(auto_clear_seconds / 60))to ensure the minutes value is always an integer rounded up, preventing premature sandbox cleanup. - Add an upper bound
wait_interval = min(auto_clear_seconds - 2, wait_interval)to guarantee at least one check occurs before the sandbox auto-clears.
Detailed Feature Description
- Import
mathmodule inrock/sdk/sandbox/client.py - Replace
self.config.auto_clear_seconds / 60withint(math.ceil(self.config.auto_clear_seconds / 60))for bothauto_clear_timeandauto_clear_time_minutesfields - Add
wait_interval = min(self.config.auto_clear_seconds - 2, wait_interval)inwait_for_process()to cap the polling interval
- Dominant language
- Python
- Stars
- 485
- Forks
- 81
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alibaba/ROCK
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-2 days Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100