Skip to content
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

Fix Kubernetes POD deployment goroutine leak #5693

Merged
merged 14 commits into from
Jun 13, 2023
Merged

Fix Kubernetes POD deployment goroutine leak #5693

merged 14 commits into from
Jun 13, 2023

Conversation

vinayada1
Copy link
Contributor

@vinayada1 vinayada1 commented Jun 9, 2023

Description

Fixes goroutine leak in kubernetes handler. The informerfactory which was started in a goroutine was invoked with an option wait.NeverStop which caused the informer to keep the associated goroutines lingering around

#5237

Fixes: #5237

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Adds necessary unit tests for change
  • Adds necessary E2E tests for change
  • Unit tests passing
  • Extended the documentation / Created issue for it

Auto-generated summary

🤖 Generated by Copilot at d1fc1d4

Summary

🚀🐛🧹

Improved logging and error handling for async operations and Kubernetes informer in armrpc and corerp packages. Added goroutineID variable to worker.go to identify go routines.

goroutineID logs
panic and async tasks - /
improved error handling

Walkthrough

  • Generate and log go routine ID for async operation worker (link, link)
  • Use context for informer factory and logger in WatchUntilReady function (link, link)

@vinayada1 vinayada1 requested a review from a team as a code owner June 9, 2023 17:13
@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref d1fc1d4
Unique ID 1ea3fa2e8f
Image tag pr-1ea3fa2e8f
Click here to see the list of tools in the current test run
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-1ea3fa2e8f
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-1ea3fa2e8f
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-1ea3fa2e8f

Test Status

⌛ Building Radius and pushing container images for functional tests...
❌ Container images build failed
❌ Test recipe publishing failed

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Test Results

2 699 tests  +12   2 692 ✔️ +12   1m 54s ⏱️ -4s
   239 suites ±  0          7 💤 ±  0 
       1 files   ±  0          0 ±  0 

Results for commit 492d5de. ± Comparison against base commit 70eacc2.

This pull request removes 3 and adds 15 tests. Note that renamed tests count towards both.
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/ce619b44-85f6-45f2-aa49-31eb044600ca
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/ce619b44-85f6-45f2-aa49-31eb044600ca#01
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestDeploymentWatcher
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/e24fca6f-0596-4013-9aa2-d894c069c2af
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/e24fca6f-0596-4013-9aa2-d894c069c2af#01
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestConvertToUnstructured
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestConvertToUnstructured/invalid_provider
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestConvertToUnstructured/invalid_resource
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestConvertToUnstructured/valid_resource
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestDelete
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestDelete/existing_resource
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestDelete/existing_resource#01
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestPut
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 2176d3e
Unique ID c2be9457a1
Image tag pr-c2be9457a1
Click here to see the list of tools in the current test run
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-c2be9457a1
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-c2be9457a1
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-c2be9457a1

Test Status

⌛ Building Radius and pushing container images for functional tests...
❌ Container images build failed
❌ Test recipe publishing failed

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 7117a7f
Unique ID 82abadc2da
Image tag pr-82abadc2da
Click here to see the list of tools in the current test run
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-82abadc2da
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-82abadc2da
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-82abadc2da

Test Status

⌛ Building Radius and pushing container images for functional tests...
❌ Container images build failed
❌ Test recipe publishing failed

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 0b5e08f
Unique ID 637d8130c2
Image tag pr-637d8130c2
Click here to see the list of tools in the current test run
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-637d8130c2
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-637d8130c2
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-637d8130c2

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp functional tests...
⌛ Starting samples functional tests...
⌛ Starting corerp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
❌ corerp functional test failed. Please check the logs for more details

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

64.5

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 64.5 %
  • main branch coverage: 64.5 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

@@ -239,11 +241,11 @@ func (handler *kubernetesHandler) WatchUntilReady(ctx context.Context, informerF

deploymentInformer.AddEventHandler(handlers)
// Start the informer
informerFactory.Start(wait.NeverStop)
informerFactory.WaitForCacheSync(wait.NeverStop)
informerFactory.Start(ctx.Done())

Choose a reason for hiding this comment

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

Are you able to validate this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes....go routine count is going down by doing this.

Choose a reason for hiding this comment

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

Ah Sorry. I wanted to ask to add unit-test for this change.. As we discussed, I will add it since you're on vacation.

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref fc7495d
Unique ID 427ea73c2c
Image tag pr-427ea73c2c
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-427ea73c2c
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-427ea73c2c
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-427ea73c2c

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@youngbupark youngbupark changed the title Goroutine leak Fix Kubernetes POD deployment goroutine leak Jun 12, 2023
@github-actions
Copy link

github-actions bot commented Jun 12, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 3dd8411
Unique ID a4423bc3b7
Image tag pr-a4423bc3b7
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-a4423bc3b7
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-a4423bc3b7
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-a4423bc3b7

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref df5fe64
Unique ID 3f50b34791
Image tag pr-3f50b34791
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-3f50b34791
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-3f50b34791
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-3f50b34791

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
⌛ Starting corerp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
❌ corerp functional test failed. Please check the logs for more details
⌛ Starting corerp functional tests...
✅ corerp functional tests succeeded

}()
handler.startDeploymentInformer(ctx, item, doneCh, errCh)
// This ensures that the informer is stopped when this function is returned.
defer cancel()
Copy link

@youngbupark youngbupark Jun 13, 2023

Choose a reason for hiding this comment

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

I realize that we do not need to call cancel explicitly when the status is matched because of this defer cancel. In any situations, informer is cancelled.

func (handler *kubernetesHandler) Delete(ctx context.Context, options *DeleteOptions) error {
identity := &resourcemodel.KubernetesIdentity{}
if err := store.DecodeMap(options.Resource.Identity.Data, identity); err != nil {
case err := <-errCh:
Copy link

@youngbupark youngbupark Jun 13, 2023

Choose a reason for hiding this comment

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

lol. we never tried to get error from the channel, which was bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

😆

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 9213257
Unique ID b2487c4552
Image tag pr-b2487c4552
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-b2487c4552
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-b2487c4552
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-b2487c4552

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...
⌛ Starting corerp functional tests...
⌛ Starting ucp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
❌ corerp functional test failed. Please check the logs for more details

)

var TestHook bool

Choose a reason for hiding this comment

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

I added timeout duration to kubernetesHandler struct. So we can avoid the test specific code in the logic. (I do not like the old pattern)

@github-actions
Copy link

63.6

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.6 %
  • main branch coverage: 63.5 %
  • diff coverage: .1 %

The coverage result does not include the functional test coverage.

return
}

// There might be parallel deployments in progress, we need to make sure we are watching the right one
if obj.Name != item.GetName() {
return
}

// This channel is used only by test code to signal that the deployment is being watched

Choose a reason for hiding this comment

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

this was used for testing. We can test without this.

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 169aeb6
Unique ID db0e03f73f
Image tag pr-db0e03f73f
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-db0e03f73f
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-db0e03f73f
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-db0e03f73f

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
⌛ Starting corerp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@@ -223,38 +191,74 @@ func (handler *kubernetesHandler) WatchUntilReady(ctx context.Context, informerF
return
}

// This channel is used only by test code to signal that the deployment is being watched
if eventHandlerInvokedCh != nil {

Choose a reason for hiding this comment

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

This is unnecessary code for testing.

}

handler.watchUntilDeploymentReady(ctx, obj, readinessCh)
handler.checkDeploymentStatus(ctx, obj, doneCh)
},
UpdateFunc: func(old_obj, new_obj any) {
old, ok := old_obj.(*v1.Deployment)

Choose a reason for hiding this comment

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

I do not know how to test this with fakeImformer. :(

@github-actions
Copy link

63.8

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.8 %
  • main branch coverage: 63.5 %
  • diff coverage: .3 %

The coverage result does not include the functional test coverage.

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 118ad2d
Unique ID dd8f0a90c8
Image tag pr-dd8f0a90c8
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-dd8f0a90c8
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-dd8f0a90c8
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-dd8f0a90c8

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
⌛ Starting samples functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref b2a8ad0
Unique ID 0eee7bd869
Image tag pr-0eee7bd869
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-0eee7bd869
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-0eee7bd869
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-0eee7bd869

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

},
UpdateFunc: func(old_obj, new_obj any) {
old, ok := old_obj.(*v1.Deployment)
if !ok {

Choose a reason for hiding this comment

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

This is the redundant check. This will never happen since it listens v1 deployment informer.

}

deploymentInformer.AddEventHandler(handlers)
// Start the informer
informerFactory.Start(wait.NeverStop)
informerFactory.WaitForCacheSync(wait.NeverStop)

Choose a reason for hiding this comment

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

This is not a good way since it waits all shared informers lol. we needs to wait with only infomers that we created here.

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref ea3de58
Unique ID 30eac36918
Image tag pr-30eac36918
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-30eac36918
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-30eac36918
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-30eac36918

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...
⌛ Starting corerp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

63.8

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.8 %
  • main branch coverage: 63.5 %
  • diff coverage: .3 %

The coverage result does not include the functional test coverage.

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref c6f7d41
Unique ID d484111f94
Image tag pr-d484111f94
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-d484111f94
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-d484111f94
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-d484111f94

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...

@github-actions
Copy link

63.8

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.8 %
  • main branch coverage: 63.5 %
  • diff coverage: .3 %

The coverage result does not include the functional test coverage.

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 1342ba6
Unique ID 6f49e67356
Image tag pr-6f49e67356
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-6f49e67356
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-6f49e67356
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-6f49e67356

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp functional tests...
⌛ Starting corerp functional tests...
⌛ Starting samples functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

63.8

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.8 %
  • main branch coverage: 63.5 %
  • diff coverage: .3 %

The coverage result does not include the functional test coverage.

Copy link
Contributor

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

LGTM - my comments here were minor, up to you whether you want to address them.

@github-actions
Copy link

github-actions bot commented Jun 13, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 492d5de
Unique ID f493fff69a
Image tag pr-f493fff69a
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-f493fff69a
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-f493fff69a
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-f493fff69a

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
✅ ucp functional tests succeeded
⌛ Starting samples functional tests...
✅ samples functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

63.8

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.8 %
  • main branch coverage: 63.5 %
  • diff coverage: .3 %

The coverage result does not include the functional test coverage.

@youngbupark
Copy link

This fix is amazing !!!

image

@youngbupark youngbupark merged commit 9e8098a into main Jun 13, 2023
@youngbupark youngbupark deleted the goroutine-leak branch June 13, 2023 21:30
nithyatsu pushed a commit that referenced this pull request Jun 21, 2023
# Description

Fixes goroutine leak in kubernetes handler. The informerfactory which
was started in a goroutine was invoked with an option wait.NeverStop
which caused the informer to keep the associated goroutines lingering
around

#5237 

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Fixes: #5237 

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [ ] Code compiles correctly
* [ ] Adds necessary unit tests for change
* [ ] Adds necessary E2E tests for change
* [ ] Unit tests passing
* [ ] Extended the documentation / Created issue for it

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at d1fc1d4</samp>

### Summary
🚀🐛🧹

<!--
1. 🚀 - This emoji can represent the improvement in performance and
concurrency by using go routines and tracking their IDs.
2. 🐛 - This emoji can represent the bug fix and error handling in case
of a panic, which can prevent crashes and data loss.
3. 🧹 - This emoji can represent the cleanup and refactoring of unused
code and better logging and shutdown logic.
-->
Improved logging and error handling for async operations and Kubernetes
informer in `armrpc` and `corerp` packages. Added `goroutineID` variable
to `worker.go` to identify go routines.

> _`goroutineID` logs_
> _panic and async tasks - /_
> _improved error handling_

### Walkthrough
* Generate and log go routine ID for async operation worker
([link](https://github.com/project-radius/radius/pull/5693/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5L232-R235),
[link](https://github.com/project-radius/radius/pull/5693/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5L245-R246))
* Use context for informer factory and logger in `WatchUntilReady`
function
([link](https://github.com/project-radius/radius/pull/5693/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L188-R189),
[link](https://github.com/project-radius/radius/pull/5693/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L242-R244))

---------

Co-authored-by: Young Bu Park <youngp@microsoft.com>
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.

Memory leak in App Core RP - number of goroutines is increasing
3 participants