Skip to content

Design discussion: avoid global state? #1149

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

Closed
andreeaflorescu opened this issue Jun 24, 2019 · 3 comments
Closed

Design discussion: avoid global state? #1149

andreeaflorescu opened this issue Jun 24, 2019 · 3 comments
Labels
Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Type: Fix Indicates a fix to existing code

Comments

@andreeaflorescu
Copy link
Member

A pain point with global state is that we cannot run unit tests in parallel (aka we run unit tests with RUST_TEST_THREADS=1) which also adds problems like we are out of memory because the state is not clean (also check #1138).

We should discuss if we should refactor Firecracker such that we don't have global state (METRICS, LOGGER, others?). This would also help in creating mock objects in tests.

@alexandruag alexandruag added the Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled label Jul 15, 2019
@dianpopa
Copy link
Contributor

dianpopa commented Sep 9, 2019

We could start by removing lazy_static! usages all across Firecracker (right now we have it in mmds, logger and net_util).
For the net_util crate, I think #1238 is a good place for removing the lazily evaluated statics.

@alsrdn alsrdn added Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` and removed Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled labels Feb 1, 2022
@alindima
Copy link
Contributor

alindima commented Mar 15, 2022

The components with global state left are logger, metrics and version_map
MMDS was tackled in this PR: #2920

@JonathanWoollett-Light JonathanWoollett-Light added Type: Fix Indicates a fix to existing code and removed Codebase: Refactoring labels Mar 23, 2023
@ShadowCurse
Copy link
Contributor

The only issue left to resolve here is #2899. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Type: Fix Indicates a fix to existing code
Projects
None yet
Development

No branches or pull requests

7 participants