Open caozhuozi opened 1 year ago
As discussed on community slack - this seems not to be an issue. Please reopen if its still an issue.
Let me share my findings here. Please correct me if I'm wrong. (The line numbers given following are based on the master branch of seldondeployment_controller.go).
the wanted svc
(the svc that seldon-core wants to create/update. I don't use the word “desired” here as there is also a related variable called desiredSvc
): first appears at line 1241
the found
one(the svc may already exist, but it may have some differences from the wanted one): first appears at line 1245
desiredSvc
(which is actually a deep copy of the found
one): first appear sat line 1279
found
one and the wanted svc
:When creating a new svc, there will be also a clusterIPs
field (and some other fields) set by default by my Kubernetes(v1.22.17-gke.3100). This field does not exist in the wanted svc
but appears in the found
one.
Because of the differences between the found
one and the wanted svc
, the equality.Semantic.DeepEqual
check at line 1262 will return false as expected.
After reassigning the wanted svc
to the found
one at line 1281, the found
currently loses the field clusterIPs
. And this will cause infinite re-update in every reconcile if there were no logic(at lines 1290-1302) to handle this situation. The logic intentionally makes ready
to be false if the above situation happens. However, the problem comes at line 1290. When the above situation happens, the check statement equality.Semantic.DeepEqual(desiredSvc.Spec, found.Spec)
will actually always return true. The reason is that found
itself actually is also updated at line 1284(evidence: you can check the source code of the methodUpdate
where there exists a Into(obj)
statement. You can then check the doc of Into
method, it says: Into
stores the result into obj).
So the desiredSvc
(which is a deep copy of found
) may always be just compared to its newer counterpart. Thus, the comparison statement at line 1290 will just always return true and make the code goes to the else
clause at line 1300, preventing the ready
to be false. The infinite re-updating still happens in every reconcile.
Can I raise a PR to fix it if the above analysis is correct?
@caozhuozi Yes please raise a PR
Describe the bug
We want to use the
serviceStatus
field ofstatus
of asdep
resource to get the svc info of all predictors. But sometimes it is missing in the sdep resource. Could you please help clarify when this field will be shown and when will not?To reproduce
just
kubectl apply
a simple sdep yaml file to create a sdep and thenkubectl get
that sdep.logs of seldon controller pod ("Updating Service" always happens in every reconcile): and there is no "Found identical Service" message found in the logs.
A sample svc created by seldon core(removed some data-sensitive part):
I think these fields are not required by seldon-core.
the corresponding sdep :
Expected behaviour
The
serviceStatus
field SHOULD be shown instatus
if the sdep is created successfully.Environment
seldon-core version: 1.14.0
Model Details
I think it is model-independent.