Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: segmentation fault #348

Merged
merged 3 commits into from
Sep 22, 2022
Merged

Conversation

chesedo
Copy link
Contributor

@chesedo chesedo commented Sep 22, 2022

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

@chesedo chesedo merged commit 995e1e3 into shuttle-hq:main Sep 22, 2022
@chesedo chesedo deleted the bug/segmentation_fault branch September 22, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant