asdf icon indicating copy to clipboard operation
asdf copied to clipboard

ASDF_CONCURRENCY should be configurable

Open augustobmoura opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe

There's no way to configure the value for ASDF_CONCURRENCY today, making it almost useless for plugin maintainers, the current behavior is to max out all cores, a situation rarely desirable

Describe the proposed solution

We should provide a way for configuring ASDF_CONCURRENCY via env vars or via $HOME/.asdfrc (both preferably)

Describe similar asdf features and why they are not sufficient

ASDF_CONCURRENCY just gets the max number of processors/cores

Describe other workarounds you've considered

The other way for plugin maintainers to provide customizable concurrency settings is to provide their CONCURRENCY env var, which makes the ecosystem more fragmented.

augustobmoura avatar Nov 24 '21 01:11 augustobmoura

I agree this is something we should fix as soon as possible. I don't think we can fix this before version 0.9.0 so I've added this to the 0.9.1 milestone.

Stratus3D avatar Dec 01 '21 22:12 Stratus3D

"Late but latest"

This can be tested on latest commit with asdf update --head

jthegedus avatar Apr 19 '23 13:04 jthegedus

Trying to find the history on the ASDF_CONCURRENCY environment variable for plugins, didn't find a ton:

  • https://github.com/asdf-vm/asdf/issues/57
  • https://github.com/asdf-vm/asdf/pull/75

Some questions/concerns I have about this feature in general:

  • Until today it wasn't configurable by the user, but with the code merged today there is still one setting for all plugins. It's possible different plugins may need different settings, or users may desire to pass different settings to different plugins.
  • The code that computes ASDF_CONCURRENCY is only 8 lines long. Since it's not doing anything terribly complicated I'm not sure why it should live in asdf-core. It seems like something that should perhaps go in a plugin shared library.
  • It doesn't seem like this is a widely used/needed feature. I don't think I've ever used it for my plugins.

Stratus3D avatar Apr 21 '23 01:04 Stratus3D

It doesn't seem like this is a widely used/needed feature

I don't believe it is.

It seems like something that should perhaps go in a plugin shared library.

I agree, but am unsure how we should support such a library.

EDIT: I gave a more thorough response in the PR comments.

jthegedus avatar Apr 21 '23 01:04 jthegedus

I decided to implement this because ASDF_CONCURRENCY was already defined and documented, so making it configurable seemed OK - different from #1402 where the environment variables didn't exist at all.

I guess this is a relatively rare feature, I probably would have implemented this in some sort of plugin shared library if one existed.

hyperupcall avatar Apr 21 '23 01:04 hyperupcall