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

fix: update num_cpus to 1.13.1 to fix cgroup parse problem #4332

Closed
wants to merge 1 commit into from

Conversation

PureWhiteWu
Copy link
Sponsor Contributor

num_cpus prior to 1.13.1 has some bugs parsing cgroup config, this PR updates num_cpus to 1.13.1 to fix it.
For more information, refer to seanmonstar/num_cpus#113.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime labels Dec 21, 2021
@Darksonn
Copy link
Contributor

We typically set Tokio to depend on the oldest version that:

  1. Is semver-compatible with the newest version.
  2. Has all of the features used by Tokio.

So in this case it is not clear why we should require the new version. People will get the newest version by default even with our current dependency configuration.

@PureWhiteWu
Copy link
Sponsor Contributor Author

We typically set Tokio to depend on the oldest version that:

  1. Is semver-compatible with the newest version.
  2. Has all of the features used by Tokio.

So in this case it is not clear why we should require the new version. People will get the newest version by default even with our current dependency configuration.

Because the old version has some bug, and the new version fixed the bug.

@Darksonn
Copy link
Contributor

Yes, I understand, but with the current configuration, people can still use the new version - in fact, they are getting the new version by default.

@PureWhiteWu
Copy link
Sponsor Contributor Author

Yes, I understand, but with the current configuration, people can still use the new version - in fact, they are getting the new version by default.

If they use --locked, then they may get the old version.
If we update this crate to 1.13.1, is there any risks or cons for us?
This update doesn't affect MSRV.

@Darksonn
Copy link
Contributor

Darksonn commented Dec 21, 2021

The main con is that we prevent users from choosing to use an older version of num_cpus.

@PureWhiteWu
Copy link
Sponsor Contributor Author

PureWhiteWu commented Dec 21, 2021

The main con is that we prevent users from choosing to use an older version of num_cpus.

Just an inquiry: so we won't update a version of our dependency for bug fixes? Or in what situation we will update our dependency?

@Darksonn
Copy link
Contributor

Darksonn commented Dec 21, 2021

I think the important thing to note here is that we are talking about increasing the minimum required version of the dependency. We usually only bump the minimum required version in two situations:

  1. The dependency released a new breaking change. In this case, we will upgrade to the new major version.
  2. Tokio requires some feature that was released in a newer version of the crate, and Tokio will not compile if you are using the old version. In this case, we will bump the minimum required version to the smallest version that has all of the features that Tokio are using from that crate.

Nothing here prevents people from getting the bugfix, and indeed they will get it by default when starting a new project or when they call cargo update.

@PureWhiteWu
Copy link
Sponsor Contributor Author

Thanks

@PureWhiteWu PureWhiteWu deleted the fix/num_cpus_bug branch December 22, 2021 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants