Skip to content

chore: cleanup grpchijacked connections - #6597

Merged
sipsma merged 1 commit into
dagger:mainfrom
jedevc:close-grpchijack
Feb 5, 2024
Merged

sipsma merged 1 commit into
dagger:mainfrom
jedevc:close-grpchijack

Conversation

@jedevc

@jedevc jedevc commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

There is a comment suggesting this? I'm not quite sure why it's not turned on, it definitely feels important.

This also clogs up every stack dump, with literally thousands of copies, since it never closes.

@sipsma is there a good reason to not do this? The stream connection can never outlive this Session call, so we should just be able to call this.

There is a comment suggesting this? I'm not quite sure why it's not
turned on, it definitely feels important.

This also clogs up every stack dump, with literally thousands of copies,
since it never closes.

Signed-off-by: Justin Chadwell <[email protected]>
@jedevc
jedevc requested a review from sipsma February 5, 2024 18:20

@sipsma sipsma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry that comment was very much a temporary note while working on that massive first Zenith PR that made it through to main on accident, should have been fixed up before merge 😞

But "this blocks if opts.RegisterClient and an error happens" was saying that conn.Close() would just block indefinitely in that case where the client is registering itself and an error occurred. Looking again though you're right though that it's gonna leak goroutines, so we can't just not close it.

IIRC it was happening at the time a lot in tests (not some obscure thing), but it's highly possible whatever case I hit where it blocked previously is no longer relevant after all the changes since that time. So If tests pass then LGTM!

@sipsma
sipsma merged commit 94caf5a into dagger:main Feb 5, 2024
@jedevc
jedevc deleted the close-grpchijack branch February 5, 2024 22:06
@jedevc

jedevc commented Feb 6, 2024 •

Copy link
Copy Markdown
Contributor Author

Hm, from when this merged we started seeing timeouts in test (https://github.com/dagger/dagger/actions/runs/7791394730/job/21247396628):

=== ␛[31mFailed␛[0m
=== ␛[31mFAIL␛[0m: core/integration  (0.00s)
panic: test timed out after 1h0m0s
running tests:
	TestModuleLotsOfFunctions (56m16s)
	TestModuleLotsOfFunctions/python_sdk (53m59s)

goroutine 22998 [running]:
testing.(*M).startAlarm.func1()
	/usr/local/go/src/testing/testing.go:2259 +0x1fc
created by time.goFunc
	/usr/local/go/src/time/sleep.go:176 +0x45

goroutine 1 [chan receive, 48 minutes, locked to thread]:
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1561 +0x8cc
testing.tRunner(0xc0005bbd40, 0xc000665b08)
	/usr/local/go/src/testing/testing.go:1601 +0x26c
testing.runTests(0xc0005eaa00?, {0x2b91460, 0x108, 0x108}, {0x1c?, 0x4ae3b9?, 0x2b9aac0?})
	/usr/local/go/src/testing/testing.go:2052 +0x897
testing.(*M).Run(0xc0005eaa00)
	/usr/local/go/src/testing/testing.go:1925 +0xb58
main.main()
	_testmain.go:573 +0x2be

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.

2 participants