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

defaultPoolConfig's use of capability count trips up max resources check #31

Open
dten opened this issue May 15, 2023 · 5 comments
Open

Comments

@dten
Copy link

dten commented May 15, 2023

Max resources must be specified when calling defaultPoolConfig but by default the stripe count is set to capability count. If someone sets max resources to for example 10, then this runs fine on a machine with 8 cores but fails with poolMaxResources must not be smaller than numStripes on a machine with 16 cores. This seems like quite an easy thing to trip over for the defaults.

@arybczak
Copy link
Contributor

Do you have any proposition for a solution?

@dten
Copy link
Author

dten commented May 20, 2023

Perhaps if the stripe count is Nothing it becomes the minimum of the number of capabilities and the max resources.
Edit: I initially wrote maximum but that's wrong lol

@fumieval
Copy link

fumieval commented Jun 7, 2023

I think #16 is a promising countermeasure

@thomasjm
Copy link

thomasjm commented Jul 3, 2023

+1, this issue makes the library much more hazardous to use. Would love to see something like #16 merged.

@chreekat
Copy link

chreekat commented Apr 8, 2024

I just got an unexpected runtime error trying to upgrade because of the related change in behavior.

I honestly have no idea what values I should be supplying now. Am I supposed to know in advance how many cores my app will be run with? Or should I artificially restrict the number of stripes...?

Ah, I see in #33 that I guess I should be using GHC.Conc.numCapabilities. Ok.

Note that #33 was incomplete. There's still a second paragraph that is in error.

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

No branches or pull requests

5 participants