Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New option --max-total-diskbytes to restrict disk storage used by a Hurl session #3463

Open
1 task
lambrospetrou opened this issue Dec 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lambrospetrou
Copy link

lambrospetrou commented Dec 2, 2024

Problem to solve

I want to control how much disk space a single hurl ... execution can use.

The existing --max-filesize option works at the single response level, but a Hurl file could (intentionally or not) repeat a request hundreds/thousands of times and saturating the disk at some point.

I understand that the vast majority of users probably control their own Hurl usage on their own systems, so they don't need this, hence why it's a feature proposal 😄 But, for running Hurl on a platform this becomes very useful to avoid using more system specific approaches (e.g. Docker, cgroups, hardware isolation, etc).

Proposal

Add a new option, for example --max-total-diskbytes that will limit the amount of responses saved locally across the whole Hurl execution. The execution should not necessarily fail, but do not store responses on disk any more, only keep them in memory as per the script to allow its assertions to function.

This limit is enforced only per execution, so no need to keep state across invocations, but should apply across all files (even when running in parallel).

Depending on the implementation, this can lead to some races since parallel execution is using separate threads, but my guess is that adding some lock-contention just before writing responses to the disk would be negligible overhead compared to the actual network downloads, but immensely useful.

Additional context and resources

This is for the platform https://www.skybear.net/ that runs user-provided Hurl files on cloud hosts.
Other CI systems, even internal to a company it could be useful to avoid some rogue scripts that have bugs from taking down CI hosts.

Tasks to complete

  • ...
@lambrospetrou lambrospetrou added the enhancement New feature or request label Dec 2, 2024
@lambrospetrou lambrospetrou changed the title New option --max-total-filesize to restrict disk based used by a Hurl session New option --max-total-filesize to restrict disk storage used by a Hurl session Dec 2, 2024
@lambrospetrou lambrospetrou changed the title New option --max-total-filesize to restrict disk storage used by a Hurl session New option --max-total-bytes to restrict disk storage used by a Hurl session Dec 2, 2024
@lambrospetrou lambrospetrou changed the title New option --max-total-bytes to restrict disk storage used by a Hurl session New option --max-total-diskbytes to restrict disk storage used by a Hurl session Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant