Skip to content

Commit

Permalink
Turn down worker logging by default
Browse files Browse the repository at this point in the history
This was accidentally left too high when we added tracing.

This patch only sets RUST_LOG if pipeline spec omits it, and it sets it
conservatively.
  • Loading branch information
emk committed Dec 14, 2022
1 parent 5eae5c0 commit f449f70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 0 additions & 4 deletions falconerid/src/job_manifest.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ spec:
# surprise evictions.
memory: "{{pipeline_spec.resource_requests.memory}}"
env:
- name: RUST_BACKTRACE
value: "1"
- name: RUST_LOG
value: "falconeri_common=trace,falconeri_worker=trace"
- name: FALCONERI_NODE_NAME
valueFrom:
fieldRef:
Expand Down
12 changes: 11 additions & 1 deletion falconerid/src/start_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ pub fn run_job(pipeline_spec: &PipelineSpec, conn: &PgConnection) -> Result<Job>
// Build our job.
let job_id = Uuid::new_v4();
let job_name = unique_kubernetes_job_name(&pipeline_spec.pipeline.name);

// If nobody specified RUST_LOG, default it sensibly.
let mut transform = pipeline_spec.transform.clone();
if !transform.env.contains_key("RUST_LOG") {
transform.env.insert(
"RUST_LOG".to_owned(),
"falconeri_common=info,falconeri_worker=info,warning".to_owned(),
);
}

let new_job = NewJob {
id: job_id,
pipeline_spec: json!({
"pipeline": pipeline_spec.pipeline,
"transform": pipeline_spec.transform,
"transform": transform,
"parallelism_spec": pipeline_spec.parallelism_spec,
"resource_requests": pipeline_spec.resource_requests,
"job_timeout": pipeline_spec.job_timeout.map(|timeout| timeout.as_secs()),
Expand Down

0 comments on commit f449f70

Please sign in to comment.