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.
Postmortem
The segmentation fault would happen as soon as we tried to use the Tokio runtime on the other side of the FFI with this spawn. From past experiences we also know that causing the Tokio runtime to cross FFI boundaries causes issues. So this was likely to be the source of the problem again... but no order of the
Bootstrapper
fields could get rid of this segmentation fault 😠 .Yet, clearly, the Tokio runtime was the issue again. This lead to checking if the Tokio version changed which led to the issue.
The issue
When API compiled
shuttle_service
it used tokio v1.21.1. However, a service, like axum hello_world, would compile with tokio v1.20.1 because it did not support v1.21.1 yet. This meant the Tokio runtime loaded by the FFI (for the service) would be different that the Tokio runtime used by API.The fix
Pin down the Tokio version in
shuttle_service
to v1.20.1 to cause API and services to compile with the same version.We can't pin to v.1.21.1 because axum, rocket, and I think another framework does not support this version yet and will fail to compile.
Fixes ENG-138