Skip to content

Commit 3d7a3d3

Browse files
committed
chore: add logs (#3247)
1 parent cdbe39a commit 3d7a3d3

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

engine/packages/gasoline/src/ctx/workflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl WorkflowCtx {
536536

537537
pub(crate) fn check_stop(&self) -> WorkflowResult<()> {
538538
if self.stop.has_changed().unwrap_or(true) {
539-
Err(WorkflowError::WorkflowStopped)
539+
Err(WorkflowError::WorkflowEvicted)
540540
} else {
541541
Ok(())
542542
}
@@ -546,7 +546,7 @@ impl WorkflowCtx {
546546
// We have to clone here because this function can't have a mutable reference to self. The state of
547547
// the stop channel doesn't matter because it only ever receives one message
548548
let _ = self.stop.clone().changed().await;
549-
Err(WorkflowError::WorkflowStopped)
549+
Err(WorkflowError::WorkflowEvicted)
550550
}
551551
}
552552

engine/packages/gasoline/src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ pub enum WorkflowError {
2828
#[error("workflow not found")]
2929
WorkflowNotFound,
3030

31-
#[error("workflow stopped")]
32-
WorkflowStopped,
31+
#[error("workflow evicted")]
32+
WorkflowEvicted,
3333

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

181181
impl WorkflowError {
182182
pub(crate) fn wake_immediate(&self) -> bool {
183-
matches!(self, WorkflowError::WorkflowStopped)
183+
matches!(self, WorkflowError::WorkflowEvicted)
184184
}
185185

186186
/// Returns the next deadline for a workflow to be woken up again based on the error.
@@ -225,7 +225,7 @@ impl WorkflowError {
225225
| WorkflowError::NoSignalFoundAndSleep(_, _)
226226
| WorkflowError::SubWorkflowIncomplete(_)
227227
| WorkflowError::Sleep(_)
228-
| WorkflowError::WorkflowStopped => true,
228+
| WorkflowError::WorkflowEvicted => true,
229229
_ => false,
230230
}
231231
}

engine/packages/pegboard-serverless/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ async fn tick_runner_config(
217217
let drain_count = curr.len().saturating_sub(desired_count);
218218
let start_count = desired_count.saturating_sub(curr.len());
219219

220+
tracing::debug!(%namespace_name, %runner_name, %desired_count, %drain_count, %start_count, "scaling");
221+
220222
if drain_count != 0 {
221223
// TODO: Implement smart logic of draining runners with the lowest allocated actors
222224
let draining_connections = curr.split_off(desired_count);
@@ -305,6 +307,8 @@ async fn outbound_handler(
305307
shutdown_rx: oneshot::Receiver<()>,
306308
draining: Arc<AtomicBool>,
307309
) -> Result<()> {
310+
tracing::debug!(%url, "sending outbound req");
311+
308312
let current_dc = ctx.config().topology().current_dc()?;
309313

310314
let client = rivet_pools::reqwest::client_no_timeout().await?;

engine/sdks/typescript/runner/src/mod.ts

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)