Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

do not interrupt sync logic when non-fatal error occured #21

Merged

Conversation

wawlian
Copy link
Contributor

@wawlian wawlian commented Jan 24, 2022

/kind enhancement

What this PR does / why we need it:

Which issue(s) this PR fixes:

Do not interrupt sync logic when non-fatal error occurs. For example, if syncing device from edge platform to k8s fails, sync logic can continue to execute to avoid interrupt updating device status from edge platform to k8s resource.

Special notes for your reviewer:

/assign @qclc

Does this PR introduce a user-facing change?

NONE

@openyurt-bot
Copy link

@wawlian: The label(s) kind/enhancement cannot be applied, because the repository doesn't have them

In response to this:

/kind enhancement

What this PR does / why we need it:

Which issue(s) this PR fixes:

Do not interrupt sync logic when non-fatal error occurs. For example, if syncing device from edge platform to k8s fails, sync logic can continue to execute to avoid interrupt updating device status from edge platform to k8s resource.

Special notes for your reviewer:

/assign @qclc

Does this PR introduce a user-facing change?

NONE

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@qclc qclc added the enhancement New feature or request label Jan 24, 2022
@@ -153,8 +150,10 @@ func (ds *DeviceSyncer) findDiffDevice(
ed := edgeDevices[i]
edName := util.GetEdgeDeviceName(&ed, EdgeXObjectName)
if _, exists := kubeDevices[edName]; !exists {
klog.V(5).Infof("found redundant edge device %s", edName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about printing all redundantEdgeDeviceNames, redundantKubeDeviceNames or syncedDeviceNames as a list? In this way, relevant information can be displayed in three logs, reducing the number of redundant log entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing all redundantEdgeDeviceNames, redundantKubeDeviceNames or syncedDeviceNames as list in one line will make this log entry very long, may be hard to read.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good to me.

redundantEdgeDevices[edName] = ds.completeCreateContent(&ed)
} else {
klog.V(5).Infof("found device %s to be synced", edName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

@qclc
Copy link
Member

qclc commented Feb 9, 2022

/lgtm

@qclc
Copy link
Member

qclc commented Feb 9, 2022

/approve

@openyurt-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qclc, wawlian

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openyurt-bot openyurt-bot merged commit 4ab23fe into openyurtio:main Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants