Skip to content

Commit

Permalink
Merge branch 'nodejs:master' into remove_socket_count_increment
Browse files Browse the repository at this point in the history
  • Loading branch information
jodevsa authored Nov 8, 2021
2 parents 94b959e + 8d6a025 commit ef2c276
Show file tree
Hide file tree
Showing 815 changed files with 5,012 additions and 23,942 deletions.
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE/4-report-a-flaky-test.md

This file was deleted.

47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/4-report-a-flaky-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Report a flaky test
description: Report a flaky test in our CI
title: "Investigate flaky test - "
labels: ["flaky-test"]
body:
- type: markdown
attributes:
value: |
Thank you for reporting a flaky test.
Flaky tests are tests that fail occasionally in the Node.js CI, but not
consistently enough to block PRs from landing, or that are failing in CI
jobs or test modes that are not run for every PR.
Please fill in as much of the form below as you're able.
- type: input
attributes:
label: Test
description: The test that is flaky.
placeholder: e.g. `test-fs-stat-bigint`
validations:
required: true
- type: input
attributes:
label: Platform
description: The platform the test is flaky on.
placeholder: e.g. `macos` or `linux`
- type: textarea
attributes:
label: Console output
description: >
A pasted console output from a failed CI job showing the whole failure
of the test.
render: console
- type: textarea
attributes:
label: Build links
description: Links to builds affected by the flaky test.
value: '- '
- type: textarea
attributes:
label: Additional information
description: >
If any investigation has been done, please include any information
found, such as how consistently the test fails, whether the failure
could be reproduced locally, when the test started failing, or anything
else you think is relevant.
4 changes: 3 additions & 1 deletion .github/workflows/auto-start-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ jobs:
ncu-config set repo ${{ env.REPOSITORY }}
- name: Start CI
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) | .[]')
run: ./tools/actions/start-ci.sh $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ jobs:
ncu-config set owner "${OWNER}"
- name: Start the commit queue
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) | .[]')
run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "tools update"
on:
schedule:
# Run once a week at 00:05 AM UTC on Saturday.
- cron: '5 0 * * 6'

workflow_dispatch:

jobs:
tools_update:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
strategy:
fail-fast: false # Prevent other jobs from aborting if one fails
matrix:
include:
- id: eslint
run: |
cd tools
NEW_VERSION=$(npm view eslint dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./node_modules/eslint/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
tools/update-eslint.sh
fi
- id: "@babel/eslint-parser"
run: |
cd tools
NEW_VERSION=$(npm view @babel/eslint-parser dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./node_modules/@babel/eslint-parser/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
tools/update-babel-eslint.sh
fi
- id: "lint-md dependencies"
run: |
cd tools/lint-md
NEW_VERSION=$(npm outdated --omit=dev --parseable | cut -d: -f4 | xargs)
if [ "$NEW_VERSION" != "" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
rm -rf package-lock.json node_modules && npm install --ignore-scripts)
make lint-md-rollup
fi
steps:
- uses: actions/checkout@v2
- run: ${{ matrix.run }}
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot <github-bot@iojs.org>
body: "This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}."
branch: "actions/tools-update-${{ matrix.id }}" # Custom branch *just* for this Action.
commit-message: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
labels: tools
title: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 9
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 172
#define V8_PATCH_LEVEL 21
#define V8_PATCH_LEVEL 25

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CallRecordWriteStubSaveRegisters(object_, scratch1_,
remembered_set_action, save_fp_mode,
StubCallMode::kCallWasmRuntimeStub);
} else {
#endif // V8_ENABLE_WEBASSEMBLY
} else {
__ CallRecordWriteStubSaveRegisters(object_, scratch1_,
remembered_set_action, save_fp_mode);
}
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/execution/isolate-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool Isolate::has_pending_message() {
}

Object Isolate::pending_exception() {
DCHECK(has_pending_exception());
CHECK(has_pending_exception());
DCHECK(!thread_local_top()->pending_exception_.IsException(this));
return thread_local_top()->pending_exception_;
}
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/heap/cppgc/marker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ void MarkerBase::EnterAtomicPause(MarkingConfig::StackState stack_state) {
}
config_.stack_state = stack_state;
config_.marking_type = MarkingConfig::MarkingType::kAtomic;
mutator_marking_state_.set_in_atomic_pause();

// Lock guards against changes to {Weak}CrossThreadPersistent handles, that
// may conflict with marking. E.g., a WeakCrossThreadPersistent may be
Expand Down
23 changes: 17 additions & 6 deletions deps/v8/src/heap/cppgc/marking-state.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/cppgc/trace-trait.h"
#include "include/cppgc/visitor.h"
#include "src/base/logging.h"
#include "src/heap/cppgc/compaction-worklists.h"
#include "src/heap/cppgc/globals.h"
#include "src/heap/cppgc/heap-object-header.h"
Expand Down Expand Up @@ -123,6 +124,8 @@ class MarkingStateBase {
discovered_new_ephemeron_pairs_ = false;
}

void set_in_atomic_pause() { in_atomic_pause_ = true; }

protected:
inline void MarkAndPush(HeapObjectHeader&, TraceDescriptor);

Expand Down Expand Up @@ -160,6 +163,7 @@ class MarkingStateBase {
size_t marked_bytes_ = 0;
bool in_ephemeron_processing_ = false;
bool discovered_new_ephemeron_pairs_ = false;
bool in_atomic_pause_ = false;
};

MarkingStateBase::MarkingStateBase(HeapBase& heap,
Expand Down Expand Up @@ -300,12 +304,19 @@ void MarkingStateBase::ProcessEphemeron(const void* key, const void* value,
// would break the main marking loop.
DCHECK(!in_ephemeron_processing_);
in_ephemeron_processing_ = true;
// Filter out already marked keys. The write barrier for WeakMember
// ensures that any newly set value after this point is kept alive and does
// not require the callback.
if (!HeapObjectHeader::FromObject(key)
.IsInConstruction<AccessMode::kAtomic>() &&
HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>()) {
// Keys are considered live even in incremental/concurrent marking settings
// because the write barrier for WeakMember ensures that any newly set value
// after this point is kept alive and does not require the callback.
const bool key_in_construction =
HeapObjectHeader::FromObject(key).IsInConstruction<AccessMode::kAtomic>();
const bool key_considered_as_live =
key_in_construction
? in_atomic_pause_
: HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>();
DCHECK_IMPLIES(
key_in_construction && in_atomic_pause_,
HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>());
if (key_considered_as_live) {
if (value_desc.base_object_payload) {
MarkAndPush(value_desc.base_object_payload, value_desc);
} else {
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/ic/accessor-assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,8 @@ void AccessorAssembler::HandleLoadICSmiHandlerLoadNamedCase(
Comment("module export");
TNode<UintPtrT> index =
DecodeWord<LoadHandler::ExportsIndexBits>(handler_word);
TNode<Module> module = LoadObjectField<Module>(
CAST(p->receiver()), JSModuleNamespace::kModuleOffset);
TNode<Module> module =
LoadObjectField<Module>(CAST(holder), JSModuleNamespace::kModuleOffset);
TNode<ObjectHashTable> exports =
LoadObjectField<ObjectHashTable>(module, Module::kExportsOffset);
TNode<Cell> cell = CAST(LoadFixedArrayElement(exports, index));
Expand Down
8 changes: 7 additions & 1 deletion deps/v8/src/ic/ic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,13 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
// We found the accessor, so the entry must exist.
DCHECK(entry.is_found());
int index = ObjectHashTable::EntryToValueIndex(entry);
return LoadHandler::LoadModuleExport(isolate(), index);
Handle<Smi> smi_handler =
LoadHandler::LoadModuleExport(isolate(), index);
if (holder_is_lookup_start_object) {
return smi_handler;
}
return LoadHandler::LoadFromPrototype(isolate(), map, holder,
smi_handler);
}

Handle<Object> accessors = lookup->GetAccessors();
Expand Down
45 changes: 45 additions & 0 deletions deps/v8/test/unittests/heap/cppgc/ephemeron-pair-unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,50 @@ TEST_F(EphemeronPairTest, EphemeronPairWithEmptyMixinValue) {
FinishMarking();
}

namespace {

class KeyWithCallback final : public GarbageCollected<KeyWithCallback> {
public:
template <typename Callback>
explicit KeyWithCallback(Callback callback) {
callback(this);
}
void Trace(Visitor*) const {}
};

class EphemeronHolderForKeyWithCallback final
: public GarbageCollected<EphemeronHolderForKeyWithCallback> {
public:
EphemeronHolderForKeyWithCallback(KeyWithCallback* key, GCed* value)
: ephemeron_pair_(key, value) {}
void Trace(cppgc::Visitor* visitor) const { visitor->Trace(ephemeron_pair_); }

private:
const EphemeronPair<KeyWithCallback, GCed> ephemeron_pair_;
};

} // namespace

TEST_F(EphemeronPairTest, EphemeronPairWithKeyInConstruction) {
GCed* value = MakeGarbageCollected<GCed>(GetAllocationHandle());
Persistent<EphemeronHolderForKeyWithCallback> holder;
InitializeMarker(*Heap::From(GetHeap()), GetPlatformHandle().get());
FinishSteps();
MakeGarbageCollected<KeyWithCallback>(
GetAllocationHandle(), [this, &holder, value](KeyWithCallback* thiz) {
// The test doesn't use conservative stack scanning to retain key to
// avoid retaining value as a side effect.
EXPECT_TRUE(HeapObjectHeader::FromObject(thiz).TryMarkAtomic());
holder = MakeGarbageCollected<EphemeronHolderForKeyWithCallback>(
GetAllocationHandle(), thiz, value);
// Finishing marking at this point will leave an ephemeron pair
// reachable where the key is still in construction. The GC needs to
// mark the value for such pairs as live in the atomic pause as they key
// is considered live.
FinishMarking();
});
EXPECT_TRUE(HeapObjectHeader::FromObject(value).IsMarked());
}

} // namespace internal
} // namespace cppgc
Loading

0 comments on commit ef2c276

Please sign in to comment.