Skip to content

Conversation

@mcpherrinm
Copy link
Contributor

@mcpherrinm mcpherrinm commented Oct 30, 2025

This is a small refactor to remove a pair of closures so we can directly launch the submission goroutines with go ctp.getOne(...).

This is itself pulled out of a slightly larger refactor which pulls the stagger sleep back out of this function, but it's much cleaner to do this refactor as a preliminary change.

There is a small functional change here: The same subCtx is passed to the submission RPC. I think that shouldn't cause any problems.

This is a small refactor to remove a pair of closures so we can directly launch
the submission goroutines with `go ctp.getOne(...)`.

This is itself pulled out of a slightly larger refactor which pulls the stagger
sleep back out of this function, but it's much cleaner to do this refactor as
a preliminary change.

There is a small functional change here: The same subCtx is passed to the
submission RPC. I think that shouldn't cause any problems.
@mcpherrinm mcpherrinm requested a review from a team as a code owner October 30, 2025 00:18
@mcpherrinm mcpherrinm requested a review from jprenken October 30, 2025 00:18
@mcpherrinm mcpherrinm marked this pull request as draft October 30, 2025 02:21
@mcpherrinm
Copy link
Contributor Author

Marking this as a draft for now so I can get the follow-up PR ready, which will make this one make more sense.

Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

I am curious to see what the follow-on refactor is. I'm totally on board with pulling getOne out to be a helper rather than a closure, but I'm not a big fan of changing its idiomatic (result, error) return into a non-idomatic and future-error-prone "you have to remember to empty-return after writing to the results channel".

@mcpherrinm
Copy link
Contributor Author

Opened as #8470

I think the main thing is that having multiple call sites to getOne means that there's no duplication of the logic at the call site. I don't 100% love it, so am definitely open to suggestions.

@mcpherrinm mcpherrinm marked this pull request as ready for review October 30, 2025 22:31
@mcpherrinm
Copy link
Contributor Author

I'm actually no longer convinced this has much extra reviewability over #8470, so I'll just close this and target that to main

@mcpherrinm mcpherrinm closed this Nov 1, 2025
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