Skip to content

Commit

Permalink
fix: remove netem distribution normal (#796)
Browse files Browse the repository at this point in the history
The netem tool creates soft locks that blocks the CPU of the node where the disruption is applied.
  • Loading branch information
aymericDD committed Oct 19, 2023
1 parent 9fe0805 commit 2aacef1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion network/tc.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (t *tc) AddNetem(ifaces []string, parent string, handle string, delay time.
params := ""

if delay.Milliseconds() != 0 {
params = fmt.Sprintf("%s delay %dms %dms distribution normal", params, delay.Milliseconds(), delayJitter.Milliseconds())
params = fmt.Sprintf("%s delay %dms %dms", params, delay.Milliseconds(), delayJitter.Milliseconds())
}

if drop != 0 {
Expand Down
6 changes: 3 additions & 3 deletions network/tc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var _ = Describe("Tc", func() {

Context("add 1s delay and 1s delayJitter to lo interface to the root parent without any handle", func() {
It("should execute", func() {
tcExecuter.AssertCalled(GinkgoT(), "Run", []string{"qdisc", "add", "dev", "lo", "root", "netem", "delay", "1000ms", "1000ms", "distribution", "normal", "loss", "5%", "duplicate", "5%", "corrupt", "1%"})
tcExecuter.AssertCalled(GinkgoT(), "Run", []string{"qdisc", "add", "dev", "lo", "root", "netem", "delay", "1000ms", "1000ms", "loss", "5%", "duplicate", "5%", "corrupt", "1%"})
})
})

Expand All @@ -90,7 +90,7 @@ var _ = Describe("Tc", func() {
})

It("should execute", func() {
tcExecuter.AssertCalled(GinkgoT(), "Run", []string{"qdisc", "add", "dev", "lo", "root", "handle", "1:", "netem", "delay", "1000ms", "1000ms", "distribution", "normal", "loss", "5%", "duplicate", "5%", "corrupt", "1%"})
tcExecuter.AssertCalled(GinkgoT(), "Run", []string{"qdisc", "add", "dev", "lo", "root", "handle", "1:", "netem", "delay", "1000ms", "1000ms", "loss", "5%", "duplicate", "5%", "corrupt", "1%"})
})
})

Expand All @@ -100,7 +100,7 @@ var _ = Describe("Tc", func() {
})

It("should execute", func() {
tcExecuter.AssertCalled(GinkgoT(), "Run", []string{"qdisc", "add", "dev", "lo", "parent", "1:4", "netem", "delay", "1000ms", "1000ms", "distribution", "normal", "loss", "5%", "duplicate", "5%", "corrupt", "1%"})
tcExecuter.AssertCalled(GinkgoT(), "Run", []string{"qdisc", "add", "dev", "lo", "parent", "1:4", "netem", "delay", "1000ms", "1000ms", "loss", "5%", "duplicate", "5%", "corrupt", "1%"})
})
})
})
Expand Down

0 comments on commit 2aacef1

Please sign in to comment.