-
Notifications
You must be signed in to change notification settings - Fork 63
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
Disable NSS modules when using the leakchecker #62
Disable NSS modules when using the leakchecker #62
Conversation
Do you know how the test-all leakchecker deal with this case? Your description makes a lot of sense, I'm just wondering if there is another way to handle this because calling |
It likely does indeed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR and the investigation!
Could you rebase so we get a run of ruby/spec in CI? |
The leakchecker will report leaked file descriptors when tests do things like access `Etc.getgrgid`, for example, if NSS modules (like `sss`) handle these lookups by connecting to a daemon like `sssd` and leave the connection open. To address this, we can call glibc's `__nss_configure_lookup` to override NSS modules configured in /etc/nsswitch.conf and only use ordinary file/DNS lookups.
I think it just doesn't - i've definitely seen
I really expected there to be an environment variable to disable NSS modules, but there just isn't - i spent quite a while staring at the glibc & sss source code looking for something. There is a way to ask NSS module to clean up, by calling |
0710533
to
8e4c979
Compare
Hm. It has the same failures as https://github.com/ruby/mspec/actions/runs/7582829391/job/20653202072. I don't know why, the ruby spec suite passed when I ran it with this mspec branch on my machine. |
Oh, I see cruby has disabled the failing set tests, for example, because the set gem v1.1.0 has a stricter test for sett-iness: ruby/ruby@dc7785e I thought that |
Anyway I'll merge this ( |
The leakchecker will report leaked file descriptors when tests do things like access `Etc.getgrgid`, for example, if NSS modules (like `sss`) handle these lookups by connecting to a daemon like `sssd` and leave the connection open. To address this, we can call glibc's `__nss_configure_lookup` to override NSS modules configured in /etc/nsswitch.conf and only use ordinary file/DNS lookups. (This is a cherry-pick of a patch applied to ruby/mspec here: ruby/mspec#62)
The leakchecker will report leaked file descriptors when tests do things like access `Etc.getgrgid`, for example, if NSS modules (like `sss`) handle these lookups by connecting to a daemon like `sssd` and leave the connection open. To address this, we can call glibc's `__nss_configure_lookup` to override NSS modules configured in /etc/nsswitch.conf and only use ordinary file/DNS lookups. (This is a cherry-pick of a patch applied to ruby/mspec here: ruby/mspec#62)
The leakchecker will report leaked file descriptors when tests do things like access `Etc.getgrgid`, for example, if NSS modules (like `sss`) handle these lookups by connecting to a daemon like `sssd` and leave the connection open. To address this, we can call glibc's `__nss_configure_lookup` to override NSS modules configured in /etc/nsswitch.conf and only use ordinary file/DNS lookups. (This is a cherry-pick of a patch applied to ruby/mspec here: ruby/mspec#62)
@KJTsanaktsidis This broke ruby/spec CI on 3.0 and 3.1 on Linux, see https://github.com/ruby/spec/actions/runs/7624400587/job/20766459296?pr=1129 |
Oh I see, I must be using fiddle features that are too new (did we move the names of the types around?). I’ll fix it first thing tomorrow - sorry about this! |
Yeah, looks like we can't depend on ruby/fiddle@49fa723 or ruby/fiddle@0ffcaa3 being available. |
@KJTsanaktsidis No worries, it happens, it's tricky to support older Rubies. |
The leakchecker will report leaked file descriptors when tests do things like access
Etc.getgrgid
, for example, if NSS modules (likesss
) handle these lookups by connecting to a daemon likesssd
and leave the connection open.To address this, we can call glibc's
__nss_configure_lookup
to override NSS modules configured in /etc/nsswitch.conf and only use ordinary file/DNS lookups.This should fix the rubyci.org failures on Amazon Linux like this one: http://rubyci.s3.amazonaws.com/amazon2023/ruby-master/log/20240119T003005Z.log.html.gz#rubyspec