Skip to content

[DEMO] DON'T MERGE#19164

Closed
stehessel wants to merge 3 commits intomasterfrom
stehessel/demo-coalescer
Closed

[DEMO] DON'T MERGE#19164
stehessel wants to merge 3 commits intomasterfrom
stehessel/demo-coalescer

Conversation

@stehessel
Copy link
Collaborator

Description

change me!

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

change me!

@openshift-ci
Copy link

openshift-ci bot commented Feb 24, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@stehessel stehessel changed the base branch from master to release-4.10 February 24, 2026 19:29
@stehessel stehessel changed the base branch from release-4.10 to master February 24, 2026 19:32
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The change to Coalescer.Coalesce removes all single-flight/coalescing behavior and context cancellation handling, effectively turning it into a plain fn() call; if this is intentional, consider renaming/removing the type or documenting the new semantics, otherwise restore the previous logic.
  • With auditableServiceEndpoints you now silently drop all service-to-service calls except the whitelisted ones; consider whether you need some observability (e.g., debug logging or metrics) for unexpected service RPCs that are no longer audited to avoid masking misconfigurations.
  • The significant increase of tokenCacheTTL/tokenTTL (3→55/4→60 minutes) changes the revocation window for these tokens; it may be worth revisiting any assumptions in Central or callers that relied on shorter-lived tokens (e.g., compromise detection or key rotation timing) to ensure behavior remains acceptable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The change to `Coalescer.Coalesce` removes all single-flight/coalescing behavior and context cancellation handling, effectively turning it into a plain `fn()` call; if this is intentional, consider renaming/removing the type or documenting the new semantics, otherwise restore the previous logic.
- With `auditableServiceEndpoints` you now silently drop all service-to-service calls except the whitelisted ones; consider whether you need some observability (e.g., debug logging or metrics) for unexpected service RPCs that are no longer audited to avoid masking misconfigurations.
- The significant increase of `tokenCacheTTL`/`tokenTTL` (3→55/4→60 minutes) changes the revocation window for these tokens; it may be worth revisiting any assumptions in Central or callers that relied on shorter-lived tokens (e.g., compromise detection or key rotation timing) to ensure behavior remains acceptable.

## Individual Comments

### Comment 1
<location path="pkg/coalescer/coalescer.go" line_range="28-29" />
<code_context>
-		}
-		return result.Val.(T), nil
-	}
+	return fn()
+	// ch := c.group.DoChan(key, func() (interface{}, error) {
+	// 	return fn()
+	// })
</code_context>
<issue_to_address>
**issue (bug_risk):** Coalesce now bypasses single-flight behavior and context handling, which is likely a functional regression.

The current code returns `fn()` directly and fully bypasses the `singleflight` flow:
- Calls sharing a `key` are no longer coalesced; every caller now runs `fn()` in parallel.
- The documented `ctx` behavior (waiting callers seeing `ctx.Err()` on cancellation while the shared call continues) is no longer preserved.
If this behavior change is intentional, please either gate it (e.g., via a flag) or update the function’s contract accordingly. Otherwise, we should restore the original `singleflight` + `select` logic so existing coalescing and cancellation semantics remain intact.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +28 to +29
return fn()
// ch := c.group.DoChan(key, func() (interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Coalesce now bypasses single-flight behavior and context handling, which is likely a functional regression.

The current code returns fn() directly and fully bypasses the singleflight flow:

  • Calls sharing a key are no longer coalesced; every caller now runs fn() in parallel.
  • The documented ctx behavior (waiting callers seeing ctx.Err() on cancellation while the shared call continues) is no longer preserved.
    If this behavior change is intentional, please either gate it (e.g., via a flag) or update the function’s contract accordingly. Otherwise, we should restore the original singleflight + select logic so existing coalescing and cancellation semantics remain intact.

@rhacs-bot
Copy link
Contributor

Images are ready for the commit at f8c73fb.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-170-gf8c73fb535.

@stehessel stehessel closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants