Skip to content

Commit ef2c276

Browse files
authored
Merge branch 'nodejs:master' into remove_socket_count_increment
2 parents 94b959e + 8d6a025 commit ef2c276

File tree

815 files changed

+5012
-23942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

815 files changed

+5012
-23942
lines changed

.github/ISSUE_TEMPLATE/4-report-a-flaky-test.md

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Report a flaky test
2+
description: Report a flaky test in our CI
3+
title: "Investigate flaky test - "
4+
labels: ["flaky-test"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for reporting a flaky test.
10+
11+
Flaky tests are tests that fail occasionally in the Node.js CI, but not
12+
consistently enough to block PRs from landing, or that are failing in CI
13+
jobs or test modes that are not run for every PR.
14+
15+
Please fill in as much of the form below as you're able.
16+
- type: input
17+
attributes:
18+
label: Test
19+
description: The test that is flaky.
20+
placeholder: e.g. `test-fs-stat-bigint`
21+
validations:
22+
required: true
23+
- type: input
24+
attributes:
25+
label: Platform
26+
description: The platform the test is flaky on.
27+
placeholder: e.g. `macos` or `linux`
28+
- type: textarea
29+
attributes:
30+
label: Console output
31+
description: >
32+
A pasted console output from a failed CI job showing the whole failure
33+
of the test.
34+
render: console
35+
- type: textarea
36+
attributes:
37+
label: Build links
38+
description: Links to builds affected by the flaky test.
39+
value: '- '
40+
- type: textarea
41+
attributes:
42+
label: Additional information
43+
description: >
44+
If any investigation has been done, please include any information
45+
found, such as how consistently the test fails, whether the failure
46+
could be reproduced locally, when the test started failing, or anything
47+
else you think is relevant.

.github/workflows/auto-start-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@ jobs:
6060
ncu-config set repo ${{ env.REPOSITORY }}
6161
6262
- name: Start CI
63-
run: ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
63+
run: ./tools/actions/start-ci.sh $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/commit-queue.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,6 @@ jobs:
7878
ncu-config set owner "${OWNER}"
7979
8080
- name: Start the commit queue
81-
run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
81+
run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}

.github/workflows/tools.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "tools update"
2+
on:
3+
schedule:
4+
# Run once a week at 00:05 AM UTC on Saturday.
5+
- cron: '5 0 * * 6'
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
tools_update:
11+
if: github.repository == 'nodejs/node'
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false # Prevent other jobs from aborting if one fails
15+
matrix:
16+
include:
17+
- id: eslint
18+
run: |
19+
cd tools
20+
NEW_VERSION=$(npm view eslint dist-tags.latest)
21+
CURRENT_VERSION=$(node -p "require('./node_modules/eslint/package.json').version")
22+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
23+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
24+
tools/update-eslint.sh
25+
fi
26+
- id: "@babel/eslint-parser"
27+
run: |
28+
cd tools
29+
NEW_VERSION=$(npm view @babel/eslint-parser dist-tags.latest)
30+
CURRENT_VERSION=$(node -p "require('./node_modules/@babel/eslint-parser/package.json').version")
31+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
32+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
33+
tools/update-babel-eslint.sh
34+
fi
35+
- id: "lint-md dependencies"
36+
run: |
37+
cd tools/lint-md
38+
NEW_VERSION=$(npm outdated --omit=dev --parseable | cut -d: -f4 | xargs)
39+
if [ "$NEW_VERSION" != "" ]; then
40+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
41+
rm -rf package-lock.json node_modules && npm install --ignore-scripts)
42+
make lint-md-rollup
43+
fi
44+
steps:
45+
- uses: actions/checkout@v2
46+
- run: ${{ matrix.run }}
47+
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
50+
with:
51+
author: Node.js GitHub Bot <[email protected]>
52+
body: "This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}."
53+
branch: "actions/tools-update-${{ matrix.id }}" # Custom branch *just* for this Action.
54+
commit-message: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
55+
labels: tools
56+
title: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 9
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 172
14-
#define V8_PATCH_LEVEL 21
14+
#define V8_PATCH_LEVEL 25
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
343343
__ CallRecordWriteStubSaveRegisters(object_, scratch1_,
344344
remembered_set_action, save_fp_mode,
345345
StubCallMode::kCallWasmRuntimeStub);
346-
} else {
347346
#endif // V8_ENABLE_WEBASSEMBLY
347+
} else {
348348
__ CallRecordWriteStubSaveRegisters(object_, scratch1_,
349349
remembered_set_action, save_fp_mode);
350350
}

deps/v8/src/execution/isolate-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool Isolate::has_pending_message() {
5050
}
5151

5252
Object Isolate::pending_exception() {
53-
DCHECK(has_pending_exception());
53+
CHECK(has_pending_exception());
5454
DCHECK(!thread_local_top()->pending_exception_.IsException(this));
5555
return thread_local_top()->pending_exception_;
5656
}

deps/v8/src/heap/cppgc/marker.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ void MarkerBase::EnterAtomicPause(MarkingConfig::StackState stack_state) {
243243
}
244244
config_.stack_state = stack_state;
245245
config_.marking_type = MarkingConfig::MarkingType::kAtomic;
246+
mutator_marking_state_.set_in_atomic_pause();
246247

247248
// Lock guards against changes to {Weak}CrossThreadPersistent handles, that
248249
// may conflict with marking. E.g., a WeakCrossThreadPersistent may be

deps/v8/src/heap/cppgc/marking-state.h

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "include/cppgc/trace-trait.h"
1111
#include "include/cppgc/visitor.h"
12+
#include "src/base/logging.h"
1213
#include "src/heap/cppgc/compaction-worklists.h"
1314
#include "src/heap/cppgc/globals.h"
1415
#include "src/heap/cppgc/heap-object-header.h"
@@ -123,6 +124,8 @@ class MarkingStateBase {
123124
discovered_new_ephemeron_pairs_ = false;
124125
}
125126

127+
void set_in_atomic_pause() { in_atomic_pause_ = true; }
128+
126129
protected:
127130
inline void MarkAndPush(HeapObjectHeader&, TraceDescriptor);
128131

@@ -160,6 +163,7 @@ class MarkingStateBase {
160163
size_t marked_bytes_ = 0;
161164
bool in_ephemeron_processing_ = false;
162165
bool discovered_new_ephemeron_pairs_ = false;
166+
bool in_atomic_pause_ = false;
163167
};
164168

165169
MarkingStateBase::MarkingStateBase(HeapBase& heap,
@@ -300,12 +304,19 @@ void MarkingStateBase::ProcessEphemeron(const void* key, const void* value,
300304
// would break the main marking loop.
301305
DCHECK(!in_ephemeron_processing_);
302306
in_ephemeron_processing_ = true;
303-
// Filter out already marked keys. The write barrier for WeakMember
304-
// ensures that any newly set value after this point is kept alive and does
305-
// not require the callback.
306-
if (!HeapObjectHeader::FromObject(key)
307-
.IsInConstruction<AccessMode::kAtomic>() &&
308-
HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>()) {
307+
// Keys are considered live even in incremental/concurrent marking settings
308+
// because the write barrier for WeakMember ensures that any newly set value
309+
// after this point is kept alive and does not require the callback.
310+
const bool key_in_construction =
311+
HeapObjectHeader::FromObject(key).IsInConstruction<AccessMode::kAtomic>();
312+
const bool key_considered_as_live =
313+
key_in_construction
314+
? in_atomic_pause_
315+
: HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>();
316+
DCHECK_IMPLIES(
317+
key_in_construction && in_atomic_pause_,
318+
HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>());
319+
if (key_considered_as_live) {
309320
if (value_desc.base_object_payload) {
310321
MarkAndPush(value_desc.base_object_payload, value_desc);
311322
} else {

deps/v8/src/ic/accessor-assembler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ void AccessorAssembler::HandleLoadICSmiHandlerLoadNamedCase(
846846
Comment("module export");
847847
TNode<UintPtrT> index =
848848
DecodeWord<LoadHandler::ExportsIndexBits>(handler_word);
849-
TNode<Module> module = LoadObjectField<Module>(
850-
CAST(p->receiver()), JSModuleNamespace::kModuleOffset);
849+
TNode<Module> module =
850+
LoadObjectField<Module>(CAST(holder), JSModuleNamespace::kModuleOffset);
851851
TNode<ObjectHashTable> exports =
852852
LoadObjectField<ObjectHashTable>(module, Module::kExportsOffset);
853853
TNode<Cell> cell = CAST(LoadFixedArrayElement(exports, index));

deps/v8/src/ic/ic.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,13 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
989989
// We found the accessor, so the entry must exist.
990990
DCHECK(entry.is_found());
991991
int index = ObjectHashTable::EntryToValueIndex(entry);
992-
return LoadHandler::LoadModuleExport(isolate(), index);
992+
Handle<Smi> smi_handler =
993+
LoadHandler::LoadModuleExport(isolate(), index);
994+
if (holder_is_lookup_start_object) {
995+
return smi_handler;
996+
}
997+
return LoadHandler::LoadFromPrototype(isolate(), map, holder,
998+
smi_handler);
993999
}
9941000

9951001
Handle<Object> accessors = lookup->GetAccessors();

deps/v8/test/unittests/heap/cppgc/ephemeron-pair-unittest.cc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,50 @@ TEST_F(EphemeronPairTest, EphemeronPairWithEmptyMixinValue) {
242242
FinishMarking();
243243
}
244244

245+
namespace {
246+
247+
class KeyWithCallback final : public GarbageCollected<KeyWithCallback> {
248+
public:
249+
template <typename Callback>
250+
explicit KeyWithCallback(Callback callback) {
251+
callback(this);
252+
}
253+
void Trace(Visitor*) const {}
254+
};
255+
256+
class EphemeronHolderForKeyWithCallback final
257+
: public GarbageCollected<EphemeronHolderForKeyWithCallback> {
258+
public:
259+
EphemeronHolderForKeyWithCallback(KeyWithCallback* key, GCed* value)
260+
: ephemeron_pair_(key, value) {}
261+
void Trace(cppgc::Visitor* visitor) const { visitor->Trace(ephemeron_pair_); }
262+
263+
private:
264+
const EphemeronPair<KeyWithCallback, GCed> ephemeron_pair_;
265+
};
266+
267+
} // namespace
268+
269+
TEST_F(EphemeronPairTest, EphemeronPairWithKeyInConstruction) {
270+
GCed* value = MakeGarbageCollected<GCed>(GetAllocationHandle());
271+
Persistent<EphemeronHolderForKeyWithCallback> holder;
272+
InitializeMarker(*Heap::From(GetHeap()), GetPlatformHandle().get());
273+
FinishSteps();
274+
MakeGarbageCollected<KeyWithCallback>(
275+
GetAllocationHandle(), [this, &holder, value](KeyWithCallback* thiz) {
276+
// The test doesn't use conservative stack scanning to retain key to
277+
// avoid retaining value as a side effect.
278+
EXPECT_TRUE(HeapObjectHeader::FromObject(thiz).TryMarkAtomic());
279+
holder = MakeGarbageCollected<EphemeronHolderForKeyWithCallback>(
280+
GetAllocationHandle(), thiz, value);
281+
// Finishing marking at this point will leave an ephemeron pair
282+
// reachable where the key is still in construction. The GC needs to
283+
// mark the value for such pairs as live in the atomic pause as they key
284+
// is considered live.
285+
FinishMarking();
286+
});
287+
EXPECT_TRUE(HeapObjectHeader::FromObject(value).IsMarked());
288+
}
289+
245290
} // namespace internal
246291
} // namespace cppgc

0 commit comments

Comments
 (0)