Skip to content

GROOVY-12033: groovy.concurrent.Actor: pre-GA hardening — Stop sentin…#2555

Draft
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12033
Draft

GROOVY-12033: groovy.concurrent.Actor: pre-GA hardening — Stop sentin…#2555
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12033

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

…el, error callback, bounded mailbox, per-actor pool

This comment was marked as outdated.

@paulk-asert paulk-asert marked this pull request as draft May 24, 2026 07:42
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 24, 2026

Codecov Report

❌ Patch coverage is 90.16393% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.2085%. Comparing base (42ce7e0) to head (39f80c1).

Files with missing lines Patch % Lines
.../org/apache/groovy/runtime/async/DefaultActor.java 92.3077% 6 Missing and 1 partial ⚠️
src/main/java/groovy/concurrent/Actor.java 64.2857% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2555        +/-   ##
==================================================
+ Coverage     68.1904%   68.2085%   +0.0181%     
- Complexity      33103      33140        +37     
==================================================
  Files            1508       1509         +1     
  Lines          126157     126257       +100     
  Branches        22891      22903        +12     
==================================================
+ Hits            86027      86118        +91     
- Misses          32490      32498         +8     
- Partials         7640       7641         +1     
Files with missing lines Coverage Δ
src/main/java/groovy/concurrent/ActorOptions.java 100.0000% <100.0000%> (ø)
src/main/java/groovy/concurrent/Actor.java 68.7500% <64.2857%> (-31.2500%) ⬇️
.../org/apache/groovy/runtime/async/DefaultActor.java 89.2562% <92.3077%> (+3.2562%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Comment on lines 217 to 219
Envelope<T> envelope = queue.take();
if (envelope.message == POISON) return;

Comment on lines +190 to +194
try {
queue.put(envelope);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new RuntimeException("Interrupted while sending to actor", ie);
Comment on lines +135 to +137
* To stop the actor from inside an error handler, call
* {@link Actor#currentSelf() Actor.<T>currentSelf().stop()}, or use
* the context-aware overload {@link #onError(TriConsumer)}.
Comment on lines 85 to 93
* asynchronously. Fire-and-forget — no reply is expected.
*
* @param message the message to send
* @throws IllegalStateException if the actor has been stopped
* @throws IllegalStateException if the actor has been stopped, or if
* the mailbox is bounded with {@link ActorOptions.Overflow#FAIL}
* and is full
*/
void send(T message);

Comment on lines +455 to +457
actor.send('first') // taken by the handler, which blocks on hold
started.await() // 'first' is off the queue when this returns
actor.send('a') // queued (1/2)
Comment on lines +484 to +486
actor.send('first') // currently being processed
started.await()
actor.send('a') // queued (1/2)
Comment on lines +510 to +512
actor.send('busy') // occupies the handler
started.await()
actor.send('queued') // fills the 1-slot queue
def actor = Actor.reactor({ msg -> started.countDown(); hold.await(); msg }, options)

actor.send('first') // being processed
started.await()
Comment on lines +309 to +312
def actor = Actor.stateful(0) { ActorContext ctx, int seen, Integer msg ->
gate.await()
log << msg
if (msg == 2) ctx.self().stop()
Comment on lines +336 to +339
def actor = Actor.stateful(100) { ActorContext ctx, int state, msg ->
gate.await()
if (msg == 'stop') { ctx.self().stop(); return state }
state + 1
…el, error callback, bounded mailbox, per-actor pool
@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 25, 2026

✅ All tests passed ✅

🏷️ Commit: 39f80c1
▶️ Tests: 92656 executed
⚪️ Checks: 28/28 completed


Learn more about TestLens at testlens.app.

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