Skip to content
Closed
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
4 changes: 2 additions & 2 deletions engine/packages/gasoline/src/ctx/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@

pub(crate) fn check_stop(&self) -> WorkflowResult<()> {
if self.stop.has_changed().unwrap_or(true) {
Err(WorkflowError::WorkflowStopped)
Err(WorkflowError::WorkflowEvicted)
} else {
Ok(())
}
Expand All @@ -546,14 +546,14 @@
// We have to clone here because this function can't have a mutable reference to self. The state of
// the stop channel doesn't matter because it only ever receives one message
let _ = self.stop.clone().changed().await;
Err(WorkflowError::WorkflowStopped)
Err(WorkflowError::WorkflowEvicted)
}
}

impl WorkflowCtx {
/// Creates a sub workflow builder.
pub fn workflow<I>(
&mut self,

Check warning on line 556 in engine/packages/gasoline/src/ctx/workflow.rs

View workflow job for this annotation

GitHub Actions / Test

hiding a lifetime that's elided elsewhere is confusing
input: impl WorkflowRepr<I>,
) -> builder::sub_workflow::SubWorkflowBuilder<impl WorkflowRepr<I>, I>
where
Expand Down Expand Up @@ -696,7 +696,7 @@
// }

/// Creates a signal builder.
pub fn signal<T: Signal + Serialize>(&mut self, body: T) -> builder::signal::SignalBuilder<T> {

Check warning on line 699 in engine/packages/gasoline/src/ctx/workflow.rs

View workflow job for this annotation

GitHub Actions / Test

hiding a lifetime that's elided elsewhere is confusing
builder::signal::SignalBuilder::new(self, self.version, body)
}

Expand Down Expand Up @@ -825,7 +825,7 @@
}

/// Creates a message builder.
pub fn msg<M: Message>(&mut self, body: M) -> builder::message::MessageBuilder<M> {

Check warning on line 828 in engine/packages/gasoline/src/ctx/workflow.rs

View workflow job for this annotation

GitHub Actions / Test

hiding a lifetime that's elided elsewhere is confusing
builder::message::MessageBuilder::new(self, self.version, body)
}

Expand Down
8 changes: 4 additions & 4 deletions engine/packages/gasoline/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub enum WorkflowError {
#[error("workflow not found")]
WorkflowNotFound,

#[error("workflow stopped")]
WorkflowStopped,
#[error("workflow evicted")]
WorkflowEvicted,

#[error("history diverged: {0}")]
HistoryDiverged(String),
Expand Down Expand Up @@ -180,7 +180,7 @@ pub enum WorkflowError {

impl WorkflowError {
pub(crate) fn wake_immediate(&self) -> bool {
matches!(self, WorkflowError::WorkflowStopped)
matches!(self, WorkflowError::WorkflowEvicted)
}

/// Returns the next deadline for a workflow to be woken up again based on the error.
Expand Down Expand Up @@ -225,7 +225,7 @@ impl WorkflowError {
| WorkflowError::NoSignalFoundAndSleep(_, _)
| WorkflowError::SubWorkflowIncomplete(_)
| WorkflowError::Sleep(_)
| WorkflowError::WorkflowStopped => true,
| WorkflowError::WorkflowEvicted => true,
_ => false,
}
}
Expand Down
4 changes: 4 additions & 0 deletions engine/packages/pegboard-serverless/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ async fn tick_runner_config(
let drain_count = curr.len().saturating_sub(desired_count);
let start_count = desired_count.saturating_sub(curr.len());

tracing::debug!(%namespace_name, %runner_name, %desired_count, %drain_count, %start_count, "scaling");

if drain_count != 0 {
// TODO: Implement smart logic of draining runners with the lowest allocated actors
let draining_connections = curr.split_off(desired_count);
Expand Down Expand Up @@ -305,6 +307,8 @@ async fn outbound_handler(
shutdown_rx: oneshot::Receiver<()>,
draining: Arc<AtomicBool>,
) -> Result<()> {
tracing::debug!(%url, "sending outbound req");

let current_dc = ctx.config().topology().current_dc()?;

let client = rivet_pools::reqwest::client_no_timeout().await?;
Expand Down
15 changes: 12 additions & 3 deletions engine/sdks/typescript/runner/src/mod.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading