Skip to content

Commit c56fc63

Browse files
authored
feat: introduce v8 locker in our codebase (#549)
* fix: use `BTreeMap` instead of `IndexMap` DESCRIPTION: vfs uses binary search internally, so it must be properly sorted. However, it is inappropriate to use IndexMap::(...)::collect() and expect the elements to be sorted. * fix: introduce `WorkerAlreadyRetired` error DESCRIPTION: When the main worker's script relays an HTTP request to the user worker, it may already be in a retired state. * fix: expose why the response failed on the main worker to the actual response * chore(base): add a dependency * chore: patch dependencies * chore: update `Cargo.lock` * stamp: fmt * chore: update `deno.json` * chore: update `.cargo/config.toml` * feat: introduce v8 locker api * fix: update integration tests * chore: update main worker script * fix(k6): add various specs * stamp: polishing * fix: make cpu timer compatible on multi-thread * fix: allow calling synchronous deno functions in the top-level context * chore: add `vendor/deno_unsync` * chore: update v8 mirror * chore: update dependencies * chore: update `Cargo.lock` * stamp: polishing * chore: update `.dprint.json`
1 parent 3c38740 commit c56fc63

Some content is hidden

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

75 files changed

+4169
-1197
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[env]
2+
RUSTY_V8_MIRROR = "https://github.com/supabase/rusty_v8/releases/download"
23
# https://supabase.com/docs/guides/functions/limits
34
SUPABASE_RESOURCE_LIMIT_MEM_MB = "256"
45
SUPABASE_RESOURCE_LIMIT_LOW_MEM_MULTIPLIER = "5"

.dprint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
".git",
2222
"target",
2323
"crates/base/test_cases/invalid_imports",
24-
"crates/base/test_cases/ai-ort-rust-backend/**/__snapshot__"
24+
"crates/base/test_cases/ai-ort-rust-backend/**/__snapshot__",
25+
"vendor/**"
2526
],
2627
"plugins": [
2728
"https://plugins.dprint.dev/typescript-0.93.2.wasm",

Cargo.lock

Lines changed: 19 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ winapi = "=0.3.9"
200200
windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Media", "Win32_Storage_FileSystem"] }
201201

202202
[patch.crates-io]
203-
# If the PR is merged upstream, remove the line below.
204203
deno_core = { git = "https://github.com/supabase/deno_core", branch = "324-supabase" }
205204
eszip = { git = "https://github.com/supabase/eszip", branch = "fix-pub-vis-0-80-1" }
205+
v8 = { git = "https://github.com/supabase/rusty_v8", tag = "v130.0.7" }
206+
deno_unsync = { path = "./vendor/deno_unsync" }
206207

207208
[profile.dind]
208209
inherits = "dev"

crates/base/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ urlencoding.workspace = true
7070
uuid.workspace = true
7171

7272
arc-swap = "1.7"
73+
async-scoped = { version = "0.9", features = ["use-tokio"] }
7374
cooked-waker = "5"
7475
flume = "0.11.0"
7576
strum = { version = "0.25", features = ["derive"] }

0 commit comments

Comments
 (0)