Skip to content

Conversation

@behzad-mir
Copy link
Contributor

Adding a defer func to connecttoTelemetryservice()

Reason for Change:
to prevent CNI from stucking when the telemetry service is unable to start.

func (tb *TelemetryBuffer) ConnectCNIToTelemetryServiceAttempt(telemetryNumRetries, telemetryWaitTimeInMilliseconds int, netPlugin *cni.Plugin, path string, args []string) error {
if err := tb.Connect(); err != nil {
log.Logf("Connection to telemetry socket failed: %v", err)
if runtime.GOOS == "windows" {
Copy link
Member

Choose a reason for hiding this comment

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

can you also place defer under this if..so no need to check if windows in 2 places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in the new commit

}
if err = StartTelemetryService(path, args); err != nil {
return errors.Wrap(err, "StartTelemetryService failed")
if err := tb.ConnectCNIToTelemetryServiceAttempt(telemetryNumRetries, telemetryWaitTimeInMilliseconds, netPlugin, path, args); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

can we rename this as startAndConnectTelemetryService

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in the new commit.

@behzad-mir behzad-mir force-pushed the behzadm-telemetryservice-defer branch from cb9e27c to 08b5782 Compare February 10, 2023 23:32
tamilmani1989
tamilmani1989 previously approved these changes Feb 11, 2023
Copy link
Member

@tamilmani1989 tamilmani1989 left a comment

Choose a reason for hiding this comment

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

lgtm

@tamilmani1989 tamilmani1989 enabled auto-merge (squash) February 11, 2023 01:08
@tamilmani1989 tamilmani1989 merged commit 879b644 into master Feb 11, 2023
@tamilmani1989 tamilmani1989 deleted the behzadm-telemetryservice-defer branch February 11, 2023 22:47
behzad-mir added a commit that referenced this pull request Feb 23, 2023
behzad-mir added a commit that referenced this pull request Feb 24, 2023
…event CNI fro…" (#1819)

* Revert "fix: Adding a defer func to connecttoTelemetryservice() to prevent CNI fro… (#1800)"

This reverts commit 879b644.

* Revert "fix: repair windows cni lock issue (#1712)"

This reverts commit 7b647be.

* mend
rjdenney pushed a commit that referenced this pull request Mar 13, 2023
…I fro… (#1800)

* Adding a defer func to connecttoTelemetryservice() to prevent CNI from stucking in case of telemetry service failure.

* fix: addressing the comments for telemetry defer function.

* fix: addressing the comments for telemetry defer func.
rjdenney pushed a commit that referenced this pull request Mar 13, 2023
…event CNI fro…" (#1819)

* Revert "fix: Adding a defer func to connecttoTelemetryservice() to prevent CNI fro… (#1800)"

This reverts commit 879b644.

* Revert "fix: repair windows cni lock issue (#1712)"

This reverts commit 7b647be.

* mend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants