feat: refill execution slots eagerly and add self-hosted Supabase guide#620
Open
feat: refill execution slots eagerly and add self-hosted Supabase guide#620
Conversation
🦋 Changeset detectedLatest commit: 34180f2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit 34180f2
☁️ Nx Cloud last updated this comment at |
4c2d2a0 to
86c664b
Compare
86c664b to
34180f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Slot-aware batch polling and graceful shutdown improvements
Concurrency-aware polling
The batch processor now checks available execution slots before polling for new messages. If no slots are free, it waits for one to open rather than polling and discarding work. The poller's
poll()method accepts an optionallimitparameter so it fetches only as many messages as there are open slots, preventing over-fetching when the queue is partially saturated.Slot notification mechanism
ExecutionControllerexposes anavailableSlotsgetter and awaitForSlot()method. When a task finishes, it callsnotifySlotWaiters()to wake any processor waiting for capacity. This allows a new poll cycle to begin as soon as a slot frees up — before the slowest task in the previous batch completes — rather than waiting for the entire batch to drain.Shutdown signal propagation
Workernow accepts an optionalrequestShutdowncallback. When the worker begins stopping, it calls this callback before aborting its internal controller, allowing the platform adapter's shared abort signal to be triggered first. This ensures pollers, executors, and handler contexts all see the abort signal promptly.SupabasePlatformAdapter.stopWorker()is updated to drain the worker before closing the SQL connection, and a newrequestShutdown()method is added to thePlatformAdapterinterface.Test coverage
worker.stop()aborts the handler'sshutdownSignaland completes within a tight time bound.stopWorkercalls abort, thenworker.stop, thensql.endin that order.Documentation
Added a Self-Hosted Supabase deployment guide covering Postgres image upgrades for pgmq compatibility,
EDGE_WORKER_DB_URLconfiguration via Supavisor, manual function deployment, and migration application. Updated the manual installation guide to reflect that the Control Plane function is no longer required and that self-hosted deployments are a primary use case.