asifdxtreme closed pull request #342: SCB-559 Instances count that show in
Service Center frontend is incorrect
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/342
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/server/core/backend/store/defer_instance.go
b/server/core/backend/store/defer_instance.go
index aa3734e9..177d8aaa 100644
--- a/server/core/backend/store/defer_instance.go
+++ b/server/core/backend/store/defer_instance.go
@@ -80,9 +80,17 @@ func (iedh *InstanceEventDeferHandler) recoverOrDefer(evt
KvEvent) error {
}
var instance pb.MicroServiceInstance
+
+ // it will happen in embed mode, and then need to get the cache
value to unmarshal
+ if kv.Value == nil {
+ if c, ok := iedh.cache.Data(key).(*mvccpb.KeyValue); ok
{
+ kv.Value = c.Value
+ }
+ }
err := json.Unmarshal(kv.Value, &instance)
if err != nil {
- util.Logger().Errorf(err, "unmarshal instance file
failed, key is %s", key)
+ util.Logger().Errorf(err, "unmarshal instance file
failed, key is %s, value is %s", key,
+ util.BytesToStringWithNoCopy(kv.Value))
return err
}
iedh.items[key] = deferItem{
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services