Skip to content

Commit a3c1b23

Browse files
committed
Merge remote-tracking branch 'origin/current' into refactor_v6_1
2 parents a4e44a2 + 23a6c2e commit a3c1b23

20 files changed

Lines changed: 272 additions & 205 deletions

File tree

.github/workflows/docs-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: Build
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1818
with:
1919
persist-credentials: false
2020

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: Build
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2020
with:
2121
persist-credentials: false
2222

.github/workflows/nodejs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: Lint
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2424
- name: Install Node.js
2525
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2626
with:
@@ -48,7 +48,7 @@ jobs:
4848

4949
runs-on: ${{matrix.os}}
5050
steps:
51-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5252
with:
5353
persist-credentials: false
5454

@@ -80,6 +80,6 @@ jobs:
8080
pull-requests: write
8181
steps:
8282
- name: Merge Dependabot PR
83-
uses: fastify/github-action-merge-dependabot@30c3f8f14a4f7b315ba38dbc1b793d27128fef82 # v3.12.0
83+
uses: fastify/github-action-merge-dependabot@73ec4cbb5e56df5591eae286972d5b2201ffe90f # v3.15.0
8484
with:
8585
github-token: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Declaring formal releases remains the prerogative of the project maintainer.
2525
## Previous Versions
2626
Every version of Piscina has its own branch. All Piscina related changes should be based on the corresponding branch.
2727

28-
Piscina's adhere to one active release line and a maintanance release line within a single year, rotating on a yearly basis.
28+
Piscina's adhere to one active release line and a maintenance release line within a single year, rotating on a yearly basis.
2929

3030
Version | Branch | Status
3131
------- | ------ | ------

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ This class extends [`EventEmitter`][] from Node.js.
419419
- `atomics`: (`sync` | `async` | `disabled`) Use the [`Atomics`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics) API for faster communication
420420
between threads. This is on by default. You can disable `Atomics` globally by
421421
setting the environment variable `PISCINA_DISABLE_ATOMICS` to `1` .
422-
If `atomics` is `sync`, it will cause to pause threads (stoping all execution)
422+
If `atomics` is `sync`, it will cause to pause threads (stopping all execution)
423423
between tasks. Ideally, threads should wait for all operations to finish before
424424
returning control to the main thread (avoid having open handles within a thread). If still want to have the possibility
425-
of having open handles or handle asynchrnous tasks, you can set the environment variable `PISCINA_ENABLE_ASYNC_ATOMICS` to `1` or setting `options.atomics` to `async`.
425+
of having open handles or handle asynchronous tasks, you can set the environment variable `PISCINA_ENABLE_ASYNC_ATOMICS` to `1` or setting `options.atomics` to `async`.
426426

427427
> **Note**: The `async` mode comes with performance penalties and can lead to undesired behaviour if open handles are not tracked correctly.
428428

@@ -690,8 +690,8 @@ Provides the current version of this library as a semver string.
690690

691691
By default, any value returned by a worker function will be cloned when
692692
returned back to the Piscina pool, even if that object is capable of
693-
being transfered. The `Piscina.move()` method can be used to wrap and
694-
mark transferable values such that they will by transfered rather than
693+
being transferred. The `Piscina.move()` method can be used to wrap and
694+
mark transferable values such that they will be transferred rather than
695695
cloned.
696696

697697
The `value` may be any object supported by Node.js to be transferable
@@ -710,7 +710,7 @@ The `move()` method will throw if the `value` is not transferable.
710710
711711
The object returned by the `move()` method should not be set as a
712712
nested value in an object. If it is used, the `move()` object itself
713-
will be cloned as opposed to transfering the object it wraps.
713+
will be cloned as opposed to transferring the object it wraps.
714714
715715
#### Interface: `Transferable`
716716
@@ -991,12 +991,6 @@ Piscina development was initially sponsored by [NearForm Research][].
991991
992992
Looking to support the development of Piscina? Consider sponsoring us on [Open Collective](https://opencollective.com/piscinajs). We appreciate all levels of support!
993993
994-
### Bronze Sponsors
995-
996-
<a href="https://testmu.ai/?utm_source=piscinajs&utm_medium=sponsor" target="_blank">
997-
<img src="https://assets.testmu.ai/resources/images/logos/black-logo.png" style="vertical-align: middle;" width="250" height="115" />
998-
</a>
999-
1000994
## Resources
1001995
1002996
[`Atomics`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics

SECURITY.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We prioritize the security of our users and ensure that our library is as secure as possible. Currently, we provide security updates primarily for the latest major version of Piscina.
6+
7+
Older versions might receive security updates depending on the severity of the vulnerability and the maintainers' bandwidth, but this is not guaranteed.
8+
9+
| Version | Supported |
10+
| ------- | ------------------ |
11+
| 6.x-rc | ⚠️ |
12+
| 5.x | :white_check_mark: |
13+
| 4.x | :white_check_mark: |
14+
| 3.x | :x: |
15+
16+
17+
## Scope & Threat Model
18+
19+
Piscina is a fast, efficient Node.js Worker Thread Pool implementation. Due to the nature of offloading tasks to separate threads, we are particularly interested in vulnerabilities related to:
20+
21+
* **Thread Isolation Bypass:** Cross-thread data leakage or unexpected state sharing between separate worker threads.
22+
* **Arbitrary Code Execution (ACE):** Ability for an attacker to manipulate the `filename` or task execution parameters to run unauthorized code.
23+
* **Denial of Service (DoS):** Exploits capable of locking up the main thread, bypassing `maxQueue` constraints, or exhausting memory resources in ways the library intends to prevent.
24+
25+
## Reporting a Vulnerability
26+
27+
👮 **Responsible Disclosure**
28+
29+
**Do not open public issues that might have security implications.** It is critical that security-related issues are reported privately so we have time to address them before they become public knowledge.
30+
31+
Individuals who find potential vulnerabilities in Piscina are invited to report them privately using the following channels:
32+
33+
1. **GitHub Security Advisories:** You can privately report a vulnerability directly via the [GitHub Security Advisory feature](https://github.com/piscinajs/piscina/security/advisories/new) on the Piscina repository.
34+
35+
### What to Include in the Report
36+
37+
To help us properly address the issue, please include the following in your report:
38+
39+
- A detailed description of the vulnerability and its potential impact.
40+
- Steps to reproduce the issue (a minimal reproduction repository or code snippet is highly appreciated).
41+
- The version(s) of `piscina` and `Node.js` affected.
42+
- Any potential mitigation or workarounds you might have found.
43+
44+
## Disclosure Policy
45+
46+
When you report a vulnerability, we will strive to follow this process:
47+
48+
1. **Acknowledgement:** We will acknowledge receipt of your vulnerability report within 3 working days.
49+
2. **Triage:** We will triage the issue, confirm the vulnerability, and determine its severity.
50+
3. **Patching:** We will work on a patch to address the vulnerability in a private fork.
51+
4. **Release:** A new version of the package will be released with the patch.
52+
5. **Public Disclosure:** Once the fix is released, we will publish a public security advisory on GitHub, giving you proper credit for the discovery (unless you prefer to remain anonymous).
53+
54+
We ask that you operate in good faith and refrain from sharing the vulnerability publicly until a fix has been released and the official advisory is published.

docs/docs/Introduction.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,3 @@ With worker threads now a well-established feature in Node.js, Piscina aims to b
3131
## Sponsors
3232

3333
Looking to support the development of Piscina? Consider sponsoring us on [Open Collective](https://opencollective.com/piscinajs). We appreciate all levels of support!
34-
35-
### Bronze Sponsors
36-
37-
<a href="https://testmu.ai/?utm_source=piscinajs&utm_medium=sponsor" target="_blank" rel="noopener noreferrer">
38-
<img src="https://assets.testmu.ai/resources/images/logos/black-logo.png" alt="TestMu.ai logo" style={{ verticalAlign: "middle" }} width="250" height="110" className="img-dark"/>
39-
<img src="https://assets.testmu.ai/resources/images/logos/white-logo.png" alt="TestMu.ai logo" style={{ verticalAlign: "middle" }} width="250" height="110" className="img-light"/>
40-
</a>

docs/docs/api-reference/class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ This class extends [`EventEmitter`](https://nodejs.org/api/events.html) from Nod
5454
- `atomics`: (`sync` | `async` | `disabled`) Use the [`Atomics`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics) API for faster communication
5555
between threads. This is on by default. You can disable `Atomics` globally by
5656
setting the environment variable `PISCINA_DISABLE_ATOMICS` to `1` .
57-
If `atomics` is `sync`, it will cause to pause threads (stoping all execution)
57+
If `atomics` is `sync`, it will cause to pause threads (stopping all execution)
5858
between tasks. Ideally, threads should wait for all operations to finish before
5959
returning control to the main thread (avoid having open handles within a thread). If still want to have the possibility
60-
of having open handles or handle asynchrnous tasks, you can set the environment variable `PISCINA_ENABLE_ASYNC_ATOMICS` to `1` or setting `options.atomics` to `async`.
60+
of having open handles or handle asynchronous tasks, you can set the environment variable `PISCINA_ENABLE_ASYNC_ATOMICS` to `1` or setting `options.atomics` to `async`.
6161

6262
:::info
6363
**Note**: The `async` mode comes with performance penalties and can lead to undesired behaviour if open handles are not tracked correctly.
@@ -113,7 +113,7 @@ This class extends [`EventEmitter`](https://nodejs.org/api/events.html) from Nod
113113

114114
:::info
115115
**Note on Explicit Resource Management**: Piscina does has support for `Symbol.dispose` and `Symbol.asyncDispose` for explicit resource management for its usage with the `using` keyword.
116-
This is only avaiable on Node.js 24 and higher.
116+
This is only available on Node.js 24 and higher.
117117

118118
For more information, see the [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management).
119119
:::

docs/docs/api-reference/static-property.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Provides the current version of this library as a semver string.
1515

1616
By default, any value returned by a worker function will be cloned when
1717
returned back to the Piscina pool, even if that object is capable of
18-
being transfered. The `Piscina.move()` method can be used to wrap and
19-
mark transferable values such that they will by transfered rather than
18+
being transferred. The `Piscina.move()` method can be used to wrap and
19+
mark transferable values such that they will be transferred rather than
2020
cloned.
2121

2222
The `value` may be any object supported by Node.js to be transferable
@@ -35,4 +35,4 @@ The `move()` method will throw if the `value` is not transferable.
3535

3636
The object returned by the `move()` method should not be set as a
3737
nested value in an object. If it is used, the `move()` object itself
38-
will be cloned as opposed to transfering the object it wraps.
38+
will be cloned as opposed to transferring the object it wraps.

docs/docs/examples/server.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ The reason `sync-sleep-pooled` and `async-sleep-pooled` yield identical results
202202
is because, in both cases, the main thread is doing identical work -- that is,
203203
receiving a request that is dispatched to a worker, waiting about 100 milliseconds,
204204
the returning the response. The main thread here does not care whether the workers
205-
are sleeping synchronously or asychronously.
205+
are sleeping synchronously or asynchronously.
206206

207207
## Tuning pool performance
208208

209209
It is possible to tune the performance of the Piscina worker pool using a variety
210210
of options:
211211

212-
* `minThreads` - The minimum number of threads always runnin
212+
* `minThreads` - The minimum number of threads always running
213213
* `maxThreads` - The maximum number of threads allowed
214214
* `idleTimeout` - The number of millisecondsa thread is permitted to remain idle
215215
* `maxQueue` -- The maximum number of pending work items
@@ -306,4 +306,4 @@ the event loop block.
306306

307307
[`autocannon`]: https://www.npmjs.com/package/autocannon
308308

309-
You can also check out this example on [github](https://github.com/piscinajs/piscina/tree/current/examples/server).
309+
You can also check out this example on [github](https://github.com/piscinajs/piscina/tree/current/examples/server).

0 commit comments

Comments
 (0)