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

Session Registry #12

Merged
merged 4 commits into from
Sep 13, 2024
Merged

Session Registry #12

merged 4 commits into from
Sep 13, 2024

Conversation

IslandUsurper
Copy link
Contributor

eipmi:get_session/2 used a list comprehension to find the right PID associated with an IPMI session. This got unacceptably slow when we tried to maintain connections to even a dozen different servers. (We hope to be able to scale to hundreds.) This PR associates the PID to the session in an ETS table, which has constant-time lookup instead of the linear-time of lists.

Note: the ETS table definition uses {write_concurrency, auto} which didn't appear until OTP 25. I know this is an important option for our use-case, but I don't know about generally. I updated the CI parameters accordingly, but if this isn't something you want to support, we can figure that out.

@schlagert
Copy link
Member

Thanks again for the contribution. Looks good to me at first glance (as always 😉). I'll have a closer look today.

@schlagert
Copy link
Member

I really would like to keep OTP-24 compatibility. I think a good compromise would be to try to create the ETS table with the new option and if that fails falling back to creation without the new option. I will merge the PR and make the necessary change in a separate commit.

@schlagert schlagert merged commit 21c1127 into lindenbaum:master Sep 13, 2024
3 checks passed
@schlagert
Copy link
Member

Do you need a release of this feature on hex.pm in the near future?

@IslandUsurper
Copy link
Contributor Author

I believe {write_concurrency, true} works on OTP 24 if you want to fallback to that when auto doesn't work.

A hex.pm release would be appreciated, but we can use my GitHub branch until then. It's just nicer not to have git: deps in mix.exs.

@IslandUsurper
Copy link
Contributor Author

Hi, @schlagert. What would be the timeframe for getting a new version on hex.pm? My manager doesn't like having git deps anywhere.

@schlagert
Copy link
Member

Hi, I'll try to get this done this week.

@schlagert
Copy link
Member

I have made the new version available on hex.pm.

@IslandUsurper IslandUsurper deleted the registry branch September 23, 2024 20:00
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.

2 participants