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

fix: limit copy concurrency #351

Merged
merged 1 commit into from Feb 1, 2023
Merged

Conversation

f0rmiga
Copy link
Contributor

@f0rmiga f0rmiga commented Feb 1, 2023

On very large directories, the copy functions were creating unbound concurrent copies, which could reach OS limits quickly or even exhaust hardware resources. This patch solves this issue by implementing a queue and a worker pattern.

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
@f0rmiga f0rmiga requested a review from jbedard February 1, 2023 19:15
@f0rmiga f0rmiga merged commit 2854f86 into main Feb 1, 2023
@f0rmiga f0rmiga deleted the f0rmiga/limit-copy-concurrency branch February 1, 2023 20:30
f0rmiga pushed a commit to aspect-build/talkie that referenced this pull request Aug 11, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [aspect_bazel_lib](https://togithub.com/aspect-build/bazel-lib) |
http_archive | minor | `v1.23.3` -> `v1.24.2` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>aspect-build/bazel-lib</summary>

###
[`v1.24.2`](https://togithub.com/aspect-build/bazel-lib/releases/tag/v1.24.2)

[Compare
Source](https://togithub.com/aspect-build/bazel-lib/compare/v1.24.1...v1.24.2)

#### Using Bzlmod with Bazel 6:

1.  Enable with `common --enable_bzlmod` in `.bazelrc`.
2.  Add to your `MODULE.bazel` file:

```starlark
bazel_dep(name = "aspect_bazel_lib", version = "1.24.2")
```

> Read more about bzlmod: <https://blog.aspect.dev/bzlmod>

#### Using WORKSPACE

Paste this snippet into your  file:

```starlark
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_bazel_lib",
    sha256 = "ef83252dea2ed8254c27e65124b756fc9476be2b73a7799b7a2a0935937fc573",
    strip_prefix = "bazel-lib-1.24.2",
    url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.24.2/bazel-lib-v1.24.2.tar.gz",
)

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

aspect_bazel_lib_dependencies()

```

Optional toolchains:

```starlark

### Register the following toolchain to use jq

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")

register_jq_toolchains()

### Register the following toolchain to use yq

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")

register_yq_toolchains()
```

#### What's Changed

- fix: update copy_directory and copy_to_directory to use binaries with
copy concurrency limited by
[@&#8203;gregmagolan](https://togithub.com/gregmagolan) in
[aspect-build/bazel-lib#352

**Full Changelog**:
aspect-build/bazel-lib@v1.24.1...v1.24.2

###
[`v1.24.1`](https://togithub.com/aspect-build/bazel-lib/releases/tag/v1.24.1)

[Compare
Source](https://togithub.com/aspect-build/bazel-lib/compare/v1.24.0...v1.24.1)

#### Using Bzlmod with Bazel 6:

1.  Enable with `common --enable_bzlmod` in `.bazelrc`.
2.  Add to your `MODULE.bazel` file:

```starlark
bazel_dep(name = "aspect_bazel_lib", version = "1.24.1")
```

> Read more about bzlmod: <https://blog.aspect.dev/bzlmod>

#### Using WORKSPACE

Paste this snippet into your  file:

```starlark
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_bazel_lib",
    sha256 = "5829c55a2400cdfbbdeeaf562bce947361d31c7cab13d56f12c34d781b6c0344",
    strip_prefix = "bazel-lib-1.24.1",
    url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.24.1/bazel-lib-v1.24.1.tar.gz",
)

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

aspect_bazel_lib_dependencies()

```

Optional toolchains:

```starlark

### Register the following toolchain to use jq

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")

register_jq_toolchains()

### Register the following toolchain to use yq

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")

register_yq_toolchains()
```

#### What's Changed

- fix: limit copy concurrency by
[@&#8203;f0rmiga](https://togithub.com/f0rmiga) in
[aspect-build/bazel-lib#351

**Full Changelog**:
aspect-build/bazel-lib@v1.24.0...v1.24.1

###
[`v1.24.0`](https://togithub.com/aspect-build/bazel-lib/releases/tag/v1.24.0)

[Compare
Source](https://togithub.com/aspect-build/bazel-lib/compare/v1.23.3...v1.24.0)

##### Using Bzlmod with Bazel 6:

1.  Enable with `common --enable_bzlmod` in `.bazelrc`.
2.  Add to your `MODULE.bazel` file:

```starlark
bazel_dep(name = "aspect_bazel_lib", version = "1.24.0")
```

> Read more about bzlmod: <https://blog.aspect.dev/bzlmod>

##### Using WORKSPACE

Paste this snippet into your  file:

```starlark
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_bazel_lib",
    sha256 = "8743da1d0d82df1eb6d9fd240fc213033b65d099ba4f7caa3ec52f6655fc25e1",
    strip_prefix = "bazel-lib-1.24.0",
    url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.24.0/bazel-lib-v1.24.0.tar.gz",
)

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

aspect_bazel_lib_dependencies()

```

Optional toolchains:

```starlark

##### Register the following toolchain to use jq

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")

register_jq_toolchains()

##### Register the following toolchain to use yq

load("@&#8203;aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")

register_yq_toolchains()
```

##### What's Changed

- chore(deps): update dependency bazel_gazelle to v0.29.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[aspect-build/bazel-lib#325
- chore(deps): update dependency io_bazel_rules_go to v0.37.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[aspect-build/bazel-lib#290
- feat: add assert helper for zip contents by
[@&#8203;alexeagle](https://togithub.com/alexeagle) in
[aspect-build/bazel-lib#342
- release: publish release artifact by
[@&#8203;alexeagle](https://togithub.com/alexeagle) in
[aspect-build/bazel-lib#350

**Full Changelog**:
aspect-build/bazel-lib@v1.23.3...v1.24.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/aspect-build/silo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTkuMCIsInVwZGF0ZWRJblZlciI6IjM0LjExOS41In0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

None yet

2 participants