-
Notifications
You must be signed in to change notification settings - Fork 61
Adjust some log in aktualizr_secondary #1609
Conversation
9654cbe
to
f2e276f
Compare
I haven't modify below 3 lines log: The reason is the first 2 lines are from libaktualizr, describing the status of database, so if we want it don't output for secondary, it means maybe we need to modify some interfaces of libaktualizr. I think maybe we don't want to modify so much to remove those 2 lines log. |
Codecov Report
@@ Coverage Diff @@
## master #1609 +/- ##
==========================================
- Coverage 82.54% 82.47% -0.07%
==========================================
Files 189 189
Lines 11991 11996 +5
==========================================
- Hits 9898 9894 -4
- Misses 2093 2102 +9
Continue to review full report at Codecov.
|
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 reason is the first 2 lines are from libaktualizr, describing the status of database, so if we want it don't output for secondary, it means maybe we need to modify some interfaces of libaktualizr. I think maybe we don't want to modify so much to remove those 2 lines log.
Fair point, but actually the Primary has the same problem.
The third one is from aktualizr_secondary, but the problem is similar as above, it's describing the status of database, I'm not sure whether we really want to add code to check if it's the first time launching.
How hard is it to fix this (and the other two)? If it requires a bunch of work, it might not be worth it, but it seems like we ought to be able to do better here.
@@ -101,6 +101,7 @@ bool AktualizrSecondary::sendFirmware(const std::string& firmware) { | |||
return false; | |||
} | |||
|
|||
LOG_INFO << "Download successful."; |
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.
Can you add the name of the target?
f2e276f
to
6db9c20
Compare
IMHO, it's doable but maybe not worthy because those log also indicating some invalid status for both of primary and secondary. If I don't want to put some ugly code into our source, I will need to change some interfaces and maybe add something into database. |
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.
IMHO, it's doable but maybe not worthy because those log also indicating some invalid status for both of primary and secondary. If I don't want to put some ugly code into our source, I will need to change some interfaces and maybe add something into database.
Fair enough. I'll look into it some more and think about it, but it doesn't have to block the rest of this.
@@ -146,14 +146,15 @@ bool SecondaryTcpServer::HandleOneConnection(int socket) { | |||
r->result = ok ? AKInstallationResult_success : AKInstallationResult_failure; | |||
} break; | |||
case AKIpUptaneMes_PR_sendFirmwareReq: { | |||
LOG_DEBUG << "Received sendFirmwareReq from Primary."; |
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.
Actually, this should probably be INFO level.
} break; | ||
case AKIpUptaneMes_PR_installReq: { | ||
LOG_DEBUG << "Received installReq from Primary."; |
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.
This should also be INFO.
@mike-sul Can you actually explain why this message is printed? I also note that after an update has been installed with aktualizr-secondary, I see "There is a valid and pending Director target to be applied" even after rebooting. I think there's a problem with how we are checking the Director metadata here. We are doing the right thing, but the logging is wrong. |
To inform that there is no target (or target metadata) verification and installation of which is currently in progress.
I agree with this statement and I think the code is inline with it. Just after |
The code works correctly, but I think the logging is misleading. First, |
Oh, now I understand your point. Yes, the first log message is misleading for sure, it should be changed or removed at all. The second one should be OK provided that the metadata are removed from DB just after successful installation, at least that was my plan. So, if the metadata are removed just after successful installation then this |
6db9c20
to
1faa65b
Compare
I've addressed these two issues in #1611. |
d90d360
to
f846587
Compare
Co-Authored-By: Patrick Vacek <patrickvacek@gmail.com> Signed-off-by: cheng.xiang <ext-cheng.xiang@here.com>
2d87ab5
to
4e9a0f7
Compare
Read and print Uptane metadata in the expected order. Be clear about connection with the Primary. Don't print a message about a pending target unless there really is one to apply. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
The metadata is not removed from the database, and it should not be. I've pushed another commit that address this issue as well as a few other minor things that were bugging me. |
What for do we need to keep it in the DB after a target update has been installed and applied? |
Got already answer to it :) |
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 but we should probably get an approval from someone that didn't write one of the commits.
No description provided.