fix: add timeout to gRPC provider Cleanup to prevent scan hang#1748
Open
MaheshYadlapati wants to merge 1 commit into
Open
fix: add timeout to gRPC provider Cleanup to prevent scan hang#1748MaheshYadlapati wants to merge 1 commit into
MaheshYadlapati wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
326bfbb to
837db65
Compare
Author
|
Hi team, raised this PR to address #1653. @MaraDascalu01, would really appreciate a review and approval when you get a chance. |
Author
|
@MaraDascalu01 , Please review and approve the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1653
Problem
driftctl scanhangs after completing all resource enumeration in certainenvironments (containerised, slow networks, CI). The scan completes
successfully but the process never exits.
Root Cause
Cleanup()inenumeration/remote/terraform/provider.gocallsclient.Close()as a bare blocking call with no timeout:The debug output from affected users confirms the scan completes and
reaches "Closing gRPC client alias=eu-north-1" — the hang is on that
call in environments where gRPC shutdown does not return cleanly.
Fix
Wrap
client.Close()in a goroutine with a 5-second timeout. If theclose does not complete within the timeout, a warning is logged and
execution continues rather than blocking forever.
No new imports required —
timeandpluginare already imported.Testing
Existing test suite unchanged. The fix is isolated to the shutdown path
and does not affect any resource enumeration or drift detection logic.