Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

PVF: Logging in PVF workers has no effect #7112

Closed
mrcnski opened this issue Apr 20, 2023 · 4 comments
Closed

PVF: Logging in PVF workers has no effect #7112

mrcnski opened this issue Apr 20, 2023 · 4 comments
Labels
I3-bug Fails to follow expected behavior. T4-parachains_engineering This PR/Issue is related to Parachains performance, stability, maintenance.

Comments

@mrcnski
Copy link
Contributor

mrcnski commented Apr 20, 2023

ISSUE

Overview

See title. In the past to do print debugging from the workers I would write to a tmp file.

How does gum work beneath the hood? @sandreim any tips?

Steps to reproduce

  1. Add sp_tracing::init_for_tests(); to execute_good_block_on_parent.
  2. Run cargo test execute_good_block_on_parent -- --nocapture.
  3. Confirm that worker logs do not appear, i.e.
gum::debug!(target: LOG_TARGET, %worker_pid, "starting pvf worker ({})", debug_id);

in worker_event_loop does not do anything.

@mrcnski mrcnski added I3-bug Fails to follow expected behavior. T4-parachains_engineering This PR/Issue is related to Parachains performance, stability, maintenance. labels Apr 20, 2023
@s0me0ne-unkn0wn
Copy link
Contributor

Are you testing your version with the separate worker or the current master? I'm pretty sure logging was working before. Do you remember you were testing this? Point 10 in that list is a message coming from the worker itself from inside the worker_event_loop, and we both surely saw that message. So if it was broken, it happened later.

@s0me0ne-unkn0wn
Copy link
Contributor

Run cargo test execute_good_block_on_parent -- --nocapture.

Haven't you forgotten to set up RUST_LOG environment variable properly?

@mrcnski
Copy link
Contributor Author

mrcnski commented Apr 20, 2023

Run cargo test execute_good_block_on_parent -- --nocapture.

Haven't you forgotten to set up RUST_LOG environment variable properly?

Ah, RUST_LOG=parachain::pvf-worker=trace did the trick. I was only seeing pvf logs even though I ran sp_tracing::init_for_tests(); in pvf-worker. 👀 So maybe that's the function that needs fixing. Quite sure I've run into this before as well, somehow.

Are you testing your version with the separate worker or the current master?

Separate worker (#7101).

@bkchr
Copy link
Member

bkchr commented Apr 20, 2023

So maybe that's the function that needs fixing. Quite sure I've run into this before as well, somehow.

Nothing needs to be fixed. You are initializing the logger with TRACE logs in the test process. The test process is spawning the worker executable that doesn't know anything about your logging setup in the test process. As @s0me0ne-unkn0wn said, you need to set RUST_LOG as env variables are inherited to child processes.

@mrcnski mrcnski closed this as completed Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug Fails to follow expected behavior. T4-parachains_engineering This PR/Issue is related to Parachains performance, stability, maintenance.
Projects
None yet
Development

No branches or pull requests

3 participants