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

Add (Web) Worker API #1

Merged
merged 101 commits into from
Jun 26, 2023
Merged

Add (Web) Worker API #1

merged 101 commits into from
Jun 26, 2023

Conversation

nhynes
Copy link
Sponsor

@nhynes nhynes commented May 27, 2023

No description provided.

@nhynes nhynes force-pushed the nhynes/worker-api branch 2 times, most recently from b24512c to 2b7855a Compare May 28, 2023 03:01
elithrar and others added 8 commits June 3, 2023 08:23
Fixes cloudflare#729 - supported in the previous Wasm prototype.
This is needed to get symbolized stacks in wd_tests. Since it is a no-op if LLVM_SYMBOLIZER is not defined, it shouldn't affect production uses.
Using `temp_store=MEMORY` to use in-memory temporary DBs, which are now allow-listed in the authorizer.

Adding the full suite of sqlite alteration functions from https://sqlite.org/src/file?name=src/alter.c&ci=trunk (see end of file)

Also moving the testing of renaming tables to be at the end of the test file, so it doesn't conflict with the other expectations.
The underlying io Trace objects are kj heap allocated. They cannot be
referenced unprotected by the TraceItem jsg object and we do not want
to restrict them to the IoContext lifetime. Instead we'll extract the
detail we need on TraceItem creation.
@nhynes nhynes force-pushed the nhynes/worker-api branch 2 times, most recently from 599f41a to fefd997 Compare June 8, 2023 09:57
jasnell and others added 17 commits June 8, 2023 08:05
Co-authored-by: Kian <kian@kian.org.uk>
In V8 11.5, things changed so that the `ResetRoot()` callback might be called on a background thread. A new method, `TryResetRoot()`, can be implemented to return false in order to prevent this and force `ResetRoot()` back to the main thread. However, its default implementation just calls `ResetRoot()` (on the background thread), hence the default behavior changed.

https://chromium-review.googlesource.com/c/v8/v8/+/4474708

Our `ResetRoot()` must be called on the main thread, so we must implement `TryResetRoot()` to return false.

This allows us to remove the `single_threaded_gc` flag we added recently as a work-around. It turns out that flag isn't actually sufficient to avoid the problem anyway.
Implement `EmbedderRootsHandler::TryResetRoot()`.
SQLite: Add point-in-time recovery API.
Although kj::hashCode() is based on a good hash, it is only a 32-bit hash and certainly not cryptographic, so collisions will happen sometimes.
The documentation for V8's `GetIdentityHash()` says that it is not guaranteed to be unique.
Enable LLVM_SYMBOLIZER by default in tests
MellowYarker and others added 14 commits June 20, 2023 09:04
When attempting to use the websocket hibernation api while running
`wrangler dev`, we saw `a.getHibernationEventType() != nullptr` errors
pop up because the hibernation event ID is defined in our internal
codebase.

Note that this change only affects server.c++, which durable objects
does not rely upon in production. This also does not enable the actual
hibernation of websockets/DOs, it's only a step towards getting
hibernatable websocket events to deliver locally.
…ally

Hardcode ws hibernation event type in workerd
To get accurate metrics when load testing an optimized build, the GC pass
that is normally done per test is now disabled.
…e-for-gc

Noop for test GC pass when not in debug
We were only removing the queued websocket when a handler was exported
so the websocket could be delivered to the hibernatable websocket event.
…ble-websocket

Remove queued websocket if no handler exported
…nd-limit-incr

sql: increase SQLITE_LIMIT_COMPOUND_SELECT to 5
This commit add a new method for hibernatable web sockets that enables
a ping/pong application autoresponse, storing the last received pong
timestamp. There's also a method to access the last received timestamp.
…onse

Application-level auto-response for hibernatable web sockets
Consecutive requests could lead to calling into the isolate whilst
code pages are being collected. This problem has only been observed
on macOS arm64.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386
Review: cloudflare#803
This reverts commit d0ac3f3.

The preceding commit adding --single-threaded-gc addresses the issue.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386
jasnell and others added 13 commits June 26, 2023 09:58
macOS 11 is the oldest version still being maintained, V8 also
depends on multithreading-related functions introduced with it.
)

With the `strict_crypto_checks` flag enabled, imported ECDH keys were
required to have empty usages, but for private keys the usage set should
be allowed to include deriveBits and deriveKey.
Since the compatibility date for the flag has not yet passed, this is
unlikely to have had a significant effect.
@nhynes nhynes merged commit dee9080 into main Jun 26, 2023
1 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet