Skip to content

Follow-up on "Support multiple workers for NODEFS /wordpress mounts" #2293

@brandonpayton

Description

@brandonpayton

We are in the midst of merging a number of large PRs:

In order to keep things moving, we merged #2231 while it still had some rough edges. This is an issue to follow up on those:

Higher priority:

  • Make fcntl and flock overrides conditional on existence of PHPLoader.fileLockManager
  • Complete multi-worker support with Asyncify
  • Implement the two missing file-lock-manager test cases
  • Make sure error logs are collected from the correct worker and/or consolidated when needed.
  • Find way to stop skipping run-cli tests
  • Fix Asyncify sqlite tests so we can stop skipping them
  • Run performance test of multi-worker setup
  • Confirm safety of node lookup in locking.is_path_to_shared_fs(). Do not assume successful lookup.
  • Look at the getpid() override and the proc_open() process ID management and make sure there are no conflicts between them.
  • Make sure get_vfs_path_from_fd() doesn't abuse or mistakenly use a native /proc dir if exposed by useHostFilesystem().
  • Return an error from get_native_path_from_vfs_path() if no native path is found and make sure callers handle that.
  • Reconcile js_getpid() with facilities we ship in the base emscripten js library. If the two don't have much overlap, let's at least acknowledge the other one in a comment. There may be some overlap, though, as proc_open can spawn a php process.

Easy:

  • Remove unnecessary nativeNodeModulesPlugin from php-wasm/node/build.js
  • Should --experimentalMultiWorker be a hidden CLI option?
  • Consider using bootRequestHandler() instead of bootWordPress() after booting the first worker.
  • For node-es-module-loader ?url import handling, grep by /@fs and see if there's any impact on matching of vite paths with .href vs .pathname. If not, we're good.

Nice to have:

  • Support sharing flock-based locks with forked processes.
  • Find way to use normal test setup for test-built-npm-packages
  • Consider alternate load balancing approach, perhaps "a moving average of total idle time per minute as a decent proxy metric"
  • Remove duplicates from ASYNCIFY_IMPORTS lists
  • Drop topOfStack testing from php-asyncify-sqlite3.spec.ts
  • Use native fcntl for fcntl-style locks.
  • Look at unifying multi-worker management with PHP process management. We don't want to have to be aware of where or how PHP is running. Consider whether php-fpm or something like it is appropriate.

Relevant but out of scope

  • Consider how to stop GH actions killing tests without using so many runners to split unit tests

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions