Skip to content

Conversation

@jianghao65536
Copy link

Before version 254, systemd used the glibc macro SOMAXCONN to set the backlog. Prior to Linux 5.4, SOMAXCONN was set to 128. If the number of instantaneous connections exceeds this value, newConnection will return EAGAIN, which can cause runc to fail when creating containers.

"testing"
)

func TestParallelConnection(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although systemd is widely used, we should skip this test if the system isn't running it. You can implement this check as shown here:

func TestUnitExistsIgnored(t *testing.T) {
if !IsRunningSystemd() {
t.Skip("Test requires systemd.")
}

defer wg.Done()
_, err := dm.newConnection()
if err != nil {
t.Error(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be t.Fatal, we don't want a bunch of similar errors.

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the test from here (without the fix, just the test case) on three different distros:

  • Fedora 42: kernel 6.16.10-200.fc42.x86_64, systemd 257.9-2.fc42
  • Alma 9: kernel 5.14.0-570.37.1.el9_6.x86_64, systemd 252-51.el9.alma.1
  • Alma 8: kernel 4.18.0-553.16.1.el8_10.x86_64, systemd 239-82.el8_10.1

and it does not fail.

This might be because Red Hat has backported systemd fix, so what distro do you recommend to try so we can see the test fails before the fix?

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.

3 participants