-
Notifications
You must be signed in to change notification settings - Fork 369
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
[Windows] CNI Server installs OpenFlow entries by PortStatus #6763
Conversation
370e578
to
4fcbe6f
Compare
4fcbe6f
to
9ee313d
Compare
// unReadyInterfaces is a map to store the OVS ports which is waiting for the PortStatus from OpenFlow switch. | ||
// The key in the map is the OVS port name, and its value is unReadyPodInfo. | ||
// It is used only on Windows now. | ||
unReadyInterfaces sync.Map |
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.
But addUnReadyPodInterface
is called from a separate goroutine, no? You cannot have a map
be updated from different goroutines.
}() | ||
} | ||
|
||
func (m *podIfaceMonitor) updatePodFlows(ifName string, ofPort int32) error { |
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.
that's fair, I was trying to reduce the number of dependencies that need to be injected into the pod monitor
we can leave it as a future change
7ed399f
to
cb09094
Compare
cb09094
to
5c1fd59
Compare
pkg/agent/cniserver/pod_monitor.go
Outdated
go wait.Until(m.worker, time.Second, stopCh) | ||
|
||
go wait.Until(func() { | ||
ticker := time.Tick(retryInterval) |
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.
Using time.Tick without stopping the ticker can cause memory leaks. Can we replace it with time.NewTicker, and make sure to defer ticker.Stop()?
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.
The ticker is removed in the latest change as Antonin suggested.
5c1fd59
to
b384c73
Compare
/test-windows-all |
/test-windows-networkpolicy |
/test-windows-e2e |
2bc767d
to
d9ea32b
Compare
c81059a
to
3d917bf
Compare
162600d
to
6f59f5e
Compare
/test-all |
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.
LGTM after the remaining comments on tests are addressed
kubeClient := fakeclientset.NewClientset() | ||
for _, obj := range objects { | ||
if obj != nil { | ||
kubeClient.Tracker().Add(obj) | ||
} | ||
} |
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.
it doesn't seem updated
6f59f5e
to
136785b
Compare
136785b
to
41c13f8
Compare
41c13f8
to
dee4e5f
Compare
…ge is received This change has introduced a worker in `podConfigurator` to listen for the OpenFlow PortStatus message when a new OpenFlow port is allocated in OVS. After receiving the message, antrea-agent Windows will install Pod related OpenFlow entries. If the OpenFlow port is not allocated within 30s after the CmdAdd request is responded, an event with type "NetworkNotReady" is added on the Pod; Whenever the Pod networking forwarding rules are installed, an event with type "NetworkIsReady" is added. Signed-off-by: Wenying Dong <[email protected]>
dee4e5f
to
73e93a9
Compare
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.
LGTM
/test-all |
@antoninbas Could you help take another look at this change? |
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.
Only very minor comments, so I will go ahead and merge this
if tc.installOpenFlowErr != nil { | ||
require.Equal(t, 1, configurator.unreadyPortQueue.Len()) | ||
key, _ := configurator.unreadyPortQueue.Get() | ||
assert.Equal(t, key, podIfName) |
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.
nit: for future reference, the expected value should come first in assert.Equal
var gotEvent string | ||
select { | ||
case gotEvent = <-testClients.recorder.Events: | ||
default: | ||
} |
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.
a comment indicating that recording events happens synchronously and hence a timeout is not necessary would have been nice here
} | ||
} | ||
} | ||
|
||
// initPortStatusMonitor has subscribed a channel to listen for the OpenFlow PortStatus message, and it also |
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.
// initPortStatusMonitor has subscribed a channel to listen for the OpenFlow PortStatus message, and it also | |
// initPortStatusMonitor subscribes a channel to listen for the OpenFlow PortStatus message, and it also |
I think we need to run Windows tests again |
/test-windows-all |
@antoninbas Windows CI testbed is down because of the limited resource, it may need another 1d to redeploy the setup and run tests. I have verified the change 3 days ago on Windows testbed, and the later change is mostly about the test code. So maybe we can bypass the re-run? windows-e2e/windows-networkpolicy had passed, windows-conformance was failed because the dependent image was not able to download. |
@wenyingd yes we can merge without the testing in that case, but we will need to run the Windows CI jobs with this change prior to the release. cc @luolanzone |
The Windows tests have passed with the latest Antrea code. Due to resource limitations, we are unable to deploy the Windows testbed before the 2.2 release. After discussion, we plan to skip Windows tests before this release, and there will be no additional Windows-related patches in release 2.2. |
This change has introduced a worker in
podConfigurator
to listen for the OpenFlow PortStatus message when a new OpenFlow port is allocated in OVS. After receiving the message, antrea-agent Windows will install Pod related OpenFlow entries. If the OpenFlow port is not allocated within 30s after the CmdAdd request is responded, an event with type "NetworkNotReady" is added on the Pod; Whenever the Pod networking forwarding rules are installed, an event with type "NetworkIsReady" is added.Fix: #6721