Skip to content

chore(amber): reduce engine log verbosity and pin the CI log-level backstop#6797

Open
aglinxinyuan wants to merge 6 commits into
apache:mainfrom
aglinxinyuan:ci-log-verbosity
Open

chore(amber): reduce engine log verbosity and pin the CI log-level backstop#6797
aglinxinyuan wants to merge 6 commits into
apache:mainfrom
aglinxinyuan:ci-log-verbosity

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Root cause. AmberLogging names each logger "<actorId>] [<ClassName>" so the logback pattern [%logger] renders both the actor id and the class. The side effect is that these logger names start with the actor id (WF6-…, COORDINATOR), not org.apache…, so the <logger name="org.apache" level="WARN"/> rule in amber/src/main/resources/logback.xml never matches the engine classes. They all fall through to the root logger and emit at INFO. In loop/integration tests, workers are recreated every iteration, so per-ECM / per-worker / per-region lines fire dozens of times and flood the CI console.

This PR demotes those statements to DEBUG so they no longer print at the default INFO level (CI, local, and prod), and demotes three WARNs that fire on normal operation:

Message Was Source
receive / process / send ECM (2–3× per control message, full ChannelIdentity dump) INFO DataProcessor.scala, main_loop.py
register <id> -> Actor[…] INFO PekkoActorRefMappingService.scala
…is not reachable anymore, it might have crashed — fires on graceful teardown WARN PekkoActorRefMappingService.scala
unknown identifier — registration race WARN PekkoActorRefMappingService.scala
worker replay log writing conf, DP thread started/exits, Starting the worker. INFO WorkflowActor, DPThread, StartHandler
Region N successfully terminated. INFO RegionExecutionManager.scala
…completed, # of input ports… INFO DataProcessor.scala
client actor cannot handle …//skip fallthrough WARN ClientActor.scala

Genuine fault paths are untouched: DP Thread exists unexpectedly (ERROR), Failed to fetch actorRef (WARN), and Error when terminating region (WARN, the failure branch — distinct from the demoted successfully terminated success branch).

As a CI backstop, the amber unit and integration test steps in build.yml pin the log level so any remaining INFO chatter is suppressed there even before the source demotions take effect. The two logging stacks spell the level differently, which is a trap worth calling out: logback takes TEXERA_SERVICE_LOG_LEVEL=WARN, but the spawned Python UDF worker uses loguru, whose only warning level is WARNING. Feeding loguru WARN raises ValueError: Level 'WARN' does not exist at worker startup — before the worker hands its Flight port back to the JVM — and the JVM then blocks on the proxy handshake with no internal timeout, hanging amber-integration until GitHub's 6 h runner cap. So the Python var is pinned to UDF_PYTHON_LOG_STREAMHANDLER_LEVEL=WARNING, and, symmetrically, logback keeps WARN (it falls back to DEBUG on an unknown level like WARNING, which would flood logs instead). amber-integration additionally gets timeout-minutes: 40 so any future worker-startup deadlock fails fast instead of burning a full runner.

Net effect: the bulk of the per-iteration output from loop/integration specs disappears from the default-level log, while DEBUG keeps it available on demand.

Any related issues, documentation, discussions?

Closes #6796

How was this PR tested?

The source demotions are a log-level-only change — no behavior changes — so they rely on the existing test suites run in CI. Verified additionally by inspection and by the CI backstop's own behavior:

  • No test asserts on a demoted message. Grepped all amber Scala and Python test sources for each demoted string; none is asserted. (ReplayLogGeneratorSpec matches "cannot handle", but against an unrelated RuntimeException from ReplayLogGenerator, not the ClientActor log.)
  • The CI WARN/WARNING env does not break config specs. UdfConfigSpec's and PekkoConfigSpec's default-value assertions are guarded (ifUnset / !sys.env.contains(...)), and pekko.stdout-loglevel is hardcoded INFO in cluster.conf (only pekko.loglevel is env-driven), so its unguarded assertion still passes.
  • loguru level names verified. On the pinned loguru 0.7.0, logger.add(sys.stderr, level="WARN") raises ValueError: Level 'WARN' does not exist while level="WARNING" succeeds (loguru's levels are TRACE/DEBUG/INFO/SUCCESS/WARNING/ERROR/CRITICAL); logback accepts WARN. With WARNING, amber-integration runs green again — the ubuntu leg finishes the integration step in ~8.5 min, versus the earlier WARN runs that sat in that step ~3 h until cancelled.
  • Lint clean. No imports added (so scalafixAll --check is unaffected); the longest changed Scala line is 96 columns (< the 100 maxColumn), so scalafmtCheckAll stays green.

A follow-up sweep for other hot-path INFO/WARN logs (e.g. AsyncRPCClient null control-reply, the range-shuffle partitioner, Tuple cast warnings) is captured in #6796 rather than expanded here.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

…ine logs

Amber engine loggers are named "<actorId>] [<ClassName>" by AmberLogging so
the pattern renders both the actor id and the class. A side effect is that
these logger names start with the actor id, not "org.apache", so the
`org.apache=WARN` rule in logback.xml never matches them and every one of
these statements emits at the root INFO level. In loop/integration tests
workers are recreated each iteration, so per-ECM, per-worker, per-region
lines fire dozens of times and flood the CI console.

Demote the chatty per-message / per-worker-lifecycle / per-region logs to
DEBUG so they no longer print at the default INFO level (CI, local, and
prod), and demote three misleading WARNs that fire on normal operation:

  * receive/process/send ECM (DataProcessor.scala, main_loop.py)
  * register->Actor / "unknown identifier" / "might have crashed"
    (PekkoActorRefMappingService.scala)
  * replay-log conf, DP thread start/exit, "Starting the worker",
    "Region N successfully terminated", operator completion
  * ClientActor "cannot handle" fallthrough

Genuine fault paths are untouched (DP-thread ERROR, "Failed to fetch
actorRef" WARN, "Error when terminating region" WARN). As a CI backstop,
pin TEXERA_SERVICE_LOG_LEVEL and UDF_PYTHON_LOG_STREAMHANDLER_LEVEL to WARN
on the amber unit and integration test steps.
Copilot AI review requested due to automatic review settings July 22, 2026 10:46
@aglinxinyuan aglinxinyuan self-assigned this Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Reduces CI console log volume by demoting high-frequency Amber engine logs (Scala + Python) from INFO/WARN to DEBUG and pinning CI log levels to WARN as a backstop.

Changes:

  • Demoted hot-path per-worker/per-message engine logs from INFO/WARN to DEBUG across Amber Scala and Python runtime paths.
  • Demoted selected WARN logs that occur during normal teardown/races to DEBUG to avoid noisy CI output.
  • Added CI workflow environment overrides to force JVM/Python worker logs to WARN in unit/integration steps.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
amber/src/main/scala/org/apache/texera/amber/engine/common/client/ClientActor.scala Demotes “cannot handle” log from WARN to DEBUG.
amber/src/main/scala/org/apache/texera/amber/engine/architecture/worker/promisehandlers/StartHandler.scala Demotes worker start log to DEBUG.
amber/src/main/scala/org/apache/texera/amber/engine/architecture/worker/DataProcessor.scala Demotes ECM receive/process/send and completion summary logs to DEBUG.
amber/src/main/scala/org/apache/texera/amber/engine/architecture/worker/DPThread.scala Demotes DP thread lifecycle logs to DEBUG.
amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/RegionExecutionManager.scala Demotes “successfully terminated” log to DEBUG.
amber/src/main/scala/org/apache/texera/amber/engine/architecture/common/WorkflowActor.scala Demotes replay-log config log to DEBUG.
amber/src/main/scala/org/apache/texera/amber/engine/architecture/common/PekkoActorRefMappingService.scala Demotes registration / normal teardown race logs to DEBUG.
amber/src/main/python/core/runnables/main_loop.py Demotes ECM receive/process/send logs to DEBUG.
.github/workflows/build.yml Pins CI log level env vars to WARN for unit/integration steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread amber/src/main/python/core/runnables/main_loop.py
Comment thread amber/src/main/python/core/runnables/main_loop.py
Comment thread amber/src/main/python/core/runnables/main_loop.py
@github-actions github-actions Bot added the ci changes related to CI label Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang, @bobbai00, @Ma77Ball
    You can notify them by mentioning @Yicong-Huang, @bobbai00, @Ma77Ball in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.36364% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.27%. Comparing base (87ec5f2) to head (b67bf3a).
⚠️ Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
...hitecture/common/PekkoActorRefMappingService.scala 0.00% 0 Missing and 3 partials ⚠️
...ber/engine/architecture/worker/DataProcessor.scala 0.00% 0 Missing and 3 partials ⚠️
...ra/amber/engine/architecture/worker/DPThread.scala 0.00% 0 Missing and 2 partials ⚠️
.../org/apache/texera/common/config/PekkoConfig.scala 75.00% 0 Missing and 2 partials ⚠️
amber/src/main/python/core/runnables/main_loop.py 66.66% 1 Missing ⚠️
...ber/engine/architecture/common/WorkflowActor.scala 0.00% 0 Missing and 1 partial ⚠️
...itecture/worker/promisehandlers/StartHandler.scala 0.00% 0 Missing and 1 partial ⚠️
...exera/amber/engine/common/client/ClientActor.scala 0.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (36.36%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6797      +/-   ##
============================================
+ Coverage     75.54%   77.27%   +1.73%     
- Complexity     3452     3522      +70     
============================================
  Files          1161     1161              
  Lines         45921    45927       +6     
  Branches       5101     5101              
============================================
+ Hits          34690    35491     +801     
+ Misses         9613     8851     -762     
+ Partials       1618     1585      -33     
Flag Coverage Δ
access-control-service 70.00% <ø> (ø)
agent-service 76.76% <ø> (ø)
amber 69.03% <31.57%> (+1.71%) ⬆️
computing-unit-managing-service 20.49% <ø> (ø)
config-service 66.66% <ø> (ø)
file-service 67.21% <ø> (ø)
frontend 82.57% <ø> (+2.52%) ⬆️
notebook-migration-service 78.94% <ø> (ø)
pyamber 92.15% <66.66%> (ø)
workflow-compiling-service 55.14% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

✅ No material benchmark regressions detected

🟢 7 better · 🔴 0 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main 87ec5f2 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 408 0.249 23,149/35,536/35,536 us 🟢 -47.3% / 🔴 +114.1%
🟢 bs=100 sw=10 sl=64 800 0.488 124,748/148,107/148,107 us 🟢 -11.7% / 🔴 +35.8%
bs=1000 sw=10 sl=64 935 0.571 1,073,256/1,117,888/1,117,888 us ⚪ within ±5% / 🔴 +7.1%
Baseline details

Latest main 87ec5f2 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 408 tuples/sec 316 tuples/sec 754.55 tuples/sec +29.1% -45.9%
bs=10 sw=10 sl=64 MB/s 0.249 MB/s 0.193 MB/s 0.461 MB/s +29.0% -45.9%
bs=10 sw=10 sl=64 p50 23,149 us 28,413 us 12,816 us -18.5% +80.6%
bs=10 sw=10 sl=64 p95 35,536 us 67,406 us 16,594 us -47.3% +114.1%
bs=10 sw=10 sl=64 p99 35,536 us 67,406 us 19,806 us -47.3% +79.4%
bs=100 sw=10 sl=64 throughput 800 tuples/sec 803 tuples/sec 969.38 tuples/sec -0.4% -17.5%
bs=100 sw=10 sl=64 MB/s 0.488 MB/s 0.49 MB/s 0.592 MB/s -0.4% -17.5%
bs=100 sw=10 sl=64 p50 124,748 us 119,000 us 103,584 us +4.8% +20.4%
bs=100 sw=10 sl=64 p95 148,107 us 167,726 us 109,097 us -11.7% +35.8%
bs=100 sw=10 sl=64 p99 148,107 us 167,726 us 117,304 us -11.7% +26.3%
bs=1000 sw=10 sl=64 throughput 935 tuples/sec 933 tuples/sec 1,004 tuples/sec +0.2% -6.8%
bs=1000 sw=10 sl=64 MB/s 0.571 MB/s 0.569 MB/s 0.613 MB/s +0.4% -6.8%
bs=1000 sw=10 sl=64 p50 1,073,256 us 1,071,835 us 1,002,357 us +0.1% +7.1%
bs=1000 sw=10 sl=64 p95 1,117,888 us 1,110,312 us 1,046,463 us +0.7% +6.8%
bs=1000 sw=10 sl=64 p99 1,117,888 us 1,110,312 us 1,073,661 us +0.7% +4.1%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,490.27,200,128000,408,0.249,23149.05,35536.30,35536.30
1,100,10,64,20,2499.93,2000,1280000,800,0.488,124747.81,148107.36,148107.36
2,1000,10,64,20,21391.71,20000,12800000,935,0.571,1073256.47,1117888.49,1117888.49

- main_loop.py: switch the three per-ECM debug logs from eager f-strings
  to loguru's lazy `{}`-placeholder form. loguru's _log short-circuits on
  core.min_level before formatting, so the ChannelIdentity/command string
  building is now skipped entirely when DEBUG is disabled (the default).
- PekkoActorRefMappingService: reword the demoted teardown log to a neutral
  "removed actor ref for <id>" — removeActorRef also runs on normal graceful
  region teardown, so the old "might have crashed" wording was misleading.

The Scala interpolated debug logs are left as-is: com.typesafe.scala-logging
3.9.6 Logger methods are macros that guard the message with isDebugEnabled,
so `s"..."` is not built when the level is disabled.
@Yicong-Huang

Copy link
Copy Markdown
Contributor

Let me review this. I may need some time

loguru has no WARN level (only WARNING), so UDF_PYTHON_LOG_STREAMHANDLER_LEVEL=WARN
made every spawned Python UDF worker raise `ValueError: Level 'WARN' does not exist`
at startup, before it connected back to the JVM. PythonProxyClient then blocked
forever on the port promise (Await.result, no timeout), so the amber-integration
job hung until GitHub's 6h cap. logback (TEXERA_SERVICE_LOG_LEVEL) keeps WARN,
which is its correct spelling.

Also add a 40-min timeout to the amber-integration job so a worker-startup
failure fails fast instead of burning a 6h runner.
@aglinxinyuan aglinxinyuan changed the title chore(amber): reduce CI log verbosity from per-worker/per-message engine logs chore(amber): reduce engine log verbosity and pin the CI log-level backstop Jul 23, 2026
@aglinxinyuan

Copy link
Copy Markdown
Contributor Author

Pushed 35203dc to fix a self-inflicted hang in this PR's own CI backstop.

The UDF_PYTHON_LOG_STREAMHANDLER_LEVEL=WARN I added flows through udf.conf into every spawned Python UDF worker, which configures loguru with it — and loguru has no WARN level, only WARNING. So each worker died at startup with ValueError: Level 'WARN' does not exist before handshaking back to the JVM, and PythonProxyClient then blocked on the port promise (Await.result, no timeout) → amber-integration hung until the 6 h cap. Both the earlier commit and the head sat ~3 h in the integration step before I cancelled them. The amber unit job stayed green because skip-integration never spawns a worker, so WARN never reached loguru there.

Fix:

  • UDF_PYTHON_LOG_STREAMHANDLER_LEVEL=WARNING for the loguru side; keep TEXERA_SERVICE_LOG_LEVEL=WARN for logback — that's its actual level name, and logback silently falls back to DEBUG on an unknown string, so WARNING there would flood logs (the opposite of the intent).
  • Added timeout-minutes: 40 to amber-integration so a worker-startup deadlock fails fast instead of burning a full runner — no job in build.yml had a job-level timeout before.

amber-integration is green again on the new run (ubuntu finished the integration step in ~8.5 min; macOS running normally).

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
- build.yml: the WARN/WARNING pins on the two amber test steps now flip
  to DEBUG when the run has "Enable debug logging" set (runner.debug ==
  '1'), so the demoted engine logs come back on demand without editing
  the workflow.
- build.yml: lower the amber-integration job timeout from 40 to 25
  minutes; the last 38 green runs on main took 9.0-16.4 min (avg 12.1),
  so 25 keeps cold-cache headroom while still failing ~14x faster than
  the 6h cap.
- PekkoActorRefMappingService: reword the teardown log to "actor <id>
  is not reachable anymore. old ref = <ref>" per review - the mapping
  service cannot tell a graceful stop from a crash, so the message now
  infers neither.
The CI backstop sets TEXERA_SERVICE_LOG_LEVEL=WARN, which cluster.conf
forwards into pekko.loglevel. Pekko only accepts OFF/ERROR/WARNING/INFO/
DEBUG (Logging.levelFor), so every ActorSystem creation printed
"unknown pekko.loglevel WARN" with a LoggerException stack trace and
fell back to ERROR - one per spec in the amber unit and integration
jobs, the very noise this PR is meant to remove.

The env knob cannot simply switch to WARNING: the same variable drives
the logback root level in logback.xml, and logback silently falls back
to DEBUG on names it does not know - flooding instead of quieting.

Normalize at the single choke point instead: PekkoConfig.pekkoConfig
(which every ActorSystem, prod and test, receives via
AmberRuntime.pekkoConfig) now rewrites pekko.loglevel through
normalizePekkoLogLevel (WARN -> WARNING, TRACE/ALL -> DEBUG), so one
env knob drives both systems in either spelling. Covered by a new
invariant test - the resolved loglevel must be pekko-valid whatever the
env holds, red on WARN before this fix - plus unit tests for the
mapping.
@aglinxinyuan

Copy link
Copy Markdown
Contributor Author

Pushed b67bf3a to fix a noise regression the WARN backstop itself introduced — the CI logs were full of this on every ActorSystem creation:

[ERROR] [EventStream(pekko://CheckpointSubsystemSpec-test)] unknown pekko.loglevel WARN
org.apache.pekko.event.Logging$LoggerException

Root cause: cluster.conf forwards TEXERA_SERVICE_LOG_LEVEL into pekko.loglevel, and pekko shares loguru's vocabulary (WARNING), not logback's (WARN). On an unknown name pekko prints a LoggerException stack trace per ActorSystem and falls back to ERROR — one per spec in both amber jobs.

Why not just set WARNING in the env: the same variable drives the logback root level in logback.xml, and logback silently falls back to DEBUG on names it doesn't know — that would flood instead of quiet. The two vocabularies are irreconcilable at the env level.

Fix: normalize at the single choke point. PekkoConfig.pekkoConfig (which every ActorSystem, prod and test, receives via AmberRuntime.pekkoConfig) now rewrites pekko.loglevel through normalizePekkoLogLevel (WARN → WARNING, TRACE/ALLDEBUG), so the one env knob drives both systems in either spelling.

Test-first: added an invariant test to PekkoConfigSpec — the resolved pekko.loglevel must be in pekko's accepted set whatever the env holds — verified red under TEXERA_SERVICE_LOG_LEVEL=WARN before the fix, green after (7/7 with WARN, 65/65 Config module with env unset), plus unit tests for the mapping itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce CI log verbosity from per-worker/per-message amber engine logs

4 participants