ref(actix): Port EnvelopeProcessor to tokio [INGEST-1566 INC-202] #1470
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.
Removes the actix
SyncArbiter
in favor of a plain tokio service thatuses a semaphore around
spawn_blocking
to delegate CPU-intensive work.The service is started in the main runtime since it does not exhibit a
large footprint. Tokio runtimes have a larger number of blocking threads
than required by the
EnvelopeProcessor
.Tokio ensures that there are always threads to run blocking tasks. If
one of the tasks panics, drop handlers are still run, the panic handler
picks up the panic (reporting it to Sentry), and tokio starts a new
thread.
Note: The EnvelopeProcessor unit tests still do not require a tokio
runtime and cannot mock service dependencies. They will be ported in a
follow-up.