Skip to content

Commit

Permalink
backend: rework job termination/cancellation after v2
Browse files Browse the repository at this point in the history
  • Loading branch information
uael committed Feb 10, 2025
1 parent 702d73e commit a5b7706
Show file tree
Hide file tree
Showing 35 changed files with 542 additions and 706 deletions.

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

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

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

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

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

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

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

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

2 changes: 0 additions & 2 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ async fn cache_hub_scripts(file_path: Option<String>) -> anyhow::Result<()> {
&Uuid::nil(),
&res.content,
&mut 0,
&mut None,
&job_dir,
None,
"global",
Expand All @@ -174,7 +173,6 @@ async fn cache_hub_scripts(file_path: Option<String>) -> anyhow::Result<()> {
let envs = windmill_worker::get_common_bun_proc_envs(None).await;
let _ = windmill_worker::install_bun_lockfile(
&mut 0,
&mut None,
&job_id,
"admins",
None,
Expand Down
17 changes: 2 additions & 15 deletions backend/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use windmill_common::{
MONITOR_LOGS_ON_OBJECT_STORE, OTEL_LOGS_ENABLED, OTEL_METRICS_ENABLED, OTEL_TRACING_ENABLED,
SERVICE_LOG_RETENTION_SECS,
};
use windmill_queue::cancel_job;
use windmill_queue::cancel;
use windmill_worker::{
create_token_for_owner, handle_job_error, AuthedClient, SameWorkerPayload, SameWorkerSender,
SendResult, BUNFIG_INSTALL_SCOPES, INSTANCE_PYTHON_VERSION, JOB_DEFAULT_TIMEOUT, KEEP_JOB_DIR,
Expand Down Expand Up @@ -1698,7 +1698,6 @@ async fn handle_zombie_jobs(db: &Pool<Postgres>, base_internal_url: &str, worker
&client,
&job,
0,
None,
error::Error::ExecutionErr(format!(
"Job timed out after no ping from job since {} (ZOMBIE_JOB_TIMEOUT: {}, same_worker: {})",
last_ping
Expand Down Expand Up @@ -1836,24 +1835,12 @@ async fn cancel_zombie_flow_job(
workspace_id: &str,
message: String,
) -> Result<(), error::Error> {
let mut tx = db.begin().await?;
tracing::error!(
"zombie flow detected: {} in workspace {}. Cancelling it.",
id,
workspace_id
);
(tx, _) = cancel_job(
"monitor",
Some(message),
id,
workspace_id,
tx,
db,
true,
false,
)
.await?;
tx.commit().await?;
let _ = cancel(db, &[id], workspace_id, "monitor", &message, true, true).await?;
Ok(())
}

Expand Down
Loading

0 comments on commit a5b7706

Please sign in to comment.