Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions rivetkit-rust/packages/rivetkit-core/src/actor/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
actor_events: RwLock<Option<mpsc::UnboundedSender<ActorEvent>>>,
pub(super) lifecycle_events: RwLock<Option<mpsc::Sender<LifecycleEvent>>>,
hibernated_connection_liveness_override: RwLock<Option<BTreeSet<(Vec<u8>, Vec<u8>)>>>,
pub(super) lifecycle_event_inbox_capacity: usize,

Check warning on line 146 in rivetkit-rust/packages/rivetkit-core/src/actor/context.rs

View workflow job for this annotation

GitHub Actions / Build rivetkit-wasm

field `lifecycle_event_inbox_capacity` is never read

Check warning on line 146 in rivetkit-rust/packages/rivetkit-core/src/actor/context.rs

View workflow job for this annotation

GitHub Actions / Build rivetkit-wasm

field `lifecycle_event_inbox_capacity` is never read
pub(super) metrics: ActorMetrics,
diagnostics: ActorDiagnostics,
actor_id: String,
Expand Down Expand Up @@ -412,8 +412,7 @@
};
}
if self.0.sleep_requested.swap(true, Ordering::SeqCst) {
return Err(ActorLifecycleError::Stopping.build())
.context("sleep already requested for this generation");
return Ok(());
}
self.cancel_sleep_timer();
if Handle::try_current().is_ok() {
Expand Down Expand Up @@ -1314,7 +1313,7 @@
self.reset_sleep_timer();
}

pub(crate) fn sleep_config(&self) -> ActorConfig {

Check warning on line 1316 in rivetkit-rust/packages/rivetkit-core/src/actor/context.rs

View workflow job for this annotation

GitHub Actions / Build rivetkit-wasm

method `sleep_config` is never used

Check warning on line 1316 in rivetkit-rust/packages/rivetkit-core/src/actor/context.rs

View workflow job for this annotation

GitHub Actions / Build rivetkit-wasm

method `sleep_config` is never used
self.sleep_state_config()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,7 @@ describeDriverMatrix("Actor Sleep Db", (driverTestConfig) => {
expect(events).toContain("waituntil-after-reject");
});

// TODO(#4705): Root-cause duplicate sleep-call semantics and re-enable this coverage.
test.skip("double sleep call is a no-op", async (c) => {
test("double sleep call is a no-op", async (c) => {
const { client } = await setupDriverTest(c, driverTestConfig);

// Use a connection to send the sleep trigger, because
Expand All @@ -790,15 +789,10 @@ describeDriverMatrix("Actor Sleep Db", (driverTestConfig) => {

await waitForConnectionReady(connection);

// Trigger sleep twice rapidly via the connection.
// The second call should be a no-op because
// #sleepCalled is already true.
await connection.triggerSleep();
try {
await connection.triggerSleep();
} catch {
// May throw if actor already stopping
}
// Trigger sleep twice from the same action invocation. The second
// call should be a no-op because the first call already requested
// sleep for this actor generation.
await connection.triggerSleepTwice();

// Wait for sleep to complete
await waitFor(driverTestConfig, 1500);
Expand Down
Loading