-
Notifications
You must be signed in to change notification settings - Fork 164
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
Reduce logs #2695
Reduce logs #2695
Conversation
pkg/pillar/base/logobjecttypes.go
Outdated
return fmt.Sprintf("%s:%p", key, object) | ||
return fmt.Sprintf("%s:%p", key, object.logger) |
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 key question here is whether we always create unique loggers for each microservice running in the same process.
@gkodali-zededa do we also need to keep them apart when we have a microservice subscribe to something it publishes? In that case using the logger wouldn't be sufficient.
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.
As I can see we create separate logger for each service
eve/pkg/pillar/zedbox/zedbox.go
Line 221 in b2471c5
srvLogger, srvLog := agentlog.Init(serviceName) |
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.
In the case we have a publisher and subscriber in the same service (which we have at least in nim and probably elsewhere) they will not be treated as separate in this log map.
Also, you don't even consider the type of the object. We have the same UUID (or UUID+version, or sha) as key for objects of completely different types.
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.
Oops this is using the LogKey and not the Key and the LogKey() functions all use obe of the define LogKey strings which capture the type of the device.
But we still need to distinguish between a publish and subscribe of the identical thing. One way to do that would be to pass another arg from pubsub to LogCreate(), LogModify() and LogDelete() to indicate "publish" vs, "subscribe" and include that in they key used for this 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.
Do you mean that we have publisher and subscriber of the same type in the same agent? Let me check.
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.
Yes, we have that in a few places.
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.
I think care is required because in the LogModify we typically fatal if the map entry is not found. So we can't accidentally delete from the map.
Maybe it makes sense to split out that commit so we can merge the other commits?
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.
Yes, sounds reasonable.
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.
Seems I found root cause: #2714
I can see lots of "touchSavedConfig failed: chtimes /persist/checkpoint/lastlocalprofile: no such file or directory" in log. Seems we should ensure that we have checkpoint file to decide should we touch or create it. Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
I can see that we show array of bytes in logs which looks suboptimal Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
I can see a lot of "readConfigResponseProtoMessage\", \"level\":\"error\",\"msg\":\"Unmarshalling failed: proto: cannot parse invalid wire-format data". Seems, we should send uuidRequest and expect uuidResponse according to API docs. Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
c38eed3
to
ce9feb9
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
Changes aimed to reduce odd logs:
touchSavedConfig failed: chtimes /persist/checkpoint/lastlocalprofile: no such file or directory
)Unmarshalling failed: proto: cannot parse invalid wire-format data
)