Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aptos-workspace-server] ignore errors when writing to stdout & stderr #15780

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

vgao1996
Copy link
Contributor

This introduces two custom macros to be used within aptos-workspace-server, which allow errors to be ignored when writing to stdout & stderr.

This is to ensure aptos-workspace-server can complete its graceful shutdown sequence when being used as a child process.

  • When spawned as a child process, its stdout and stderr get piped.
  • When the parent (TS-frontend) exits, the pipes will close. The default macros (println, eprintln) will panic when writing to a closed pipe.

Copy link

trunk-io bot commented Jan 21, 2025

/// Custom macro to allow writing to stdout while ignoring any errors.
/// This is to allow handling of closed stdout (e.g. in case of a broken pipe).
#[macro_export]
macro_rules! __println {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use descriptive names and not __ prefix.

"Faucet is ready. Endpoint: http://{}:{}",
IP_LOCAL_HOST, faucet_port
IP_LOCAL_HOST,
Copy link
Contributor

Choose a reason for hiding this comment

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

Different linter?

@vgao1996 vgao1996 enabled auto-merge (squash) January 24, 2025 21:36

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on e3ad019e0011b04a480552a7051aaf4bb3bad605

two traffics test: inner traffic : committed: 14420.53 txn/s, latency: 2748.37 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3400 ms), latency samples: 5483020
two traffics test : committed: 99.98 txn/s, latency: 1459.60 ms, (p50: 1400 ms, p70: 1500, p90: 1600 ms, p99: 3900 ms), latency samples: 1800
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.545, avg: 1.458", "ConsensusProposalToOrdered: max: 0.307, avg: 0.296", "ConsensusOrderedToCommit: max: 0.423, avg: 0.404", "ConsensusProposalToCommit: max: 0.717, avg: 0.700"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.84s no progress at version 17694 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.70s no progress at version 2839064 (avg 0.70s) [limit 16].
Test Ok

Copy link
Contributor

✅ Forge suite compat success on cb5d7c9615b937357dbede9439401be640fb7d17 ==> e3ad019e0011b04a480552a7051aaf4bb3bad605

Compatibility test results for cb5d7c9615b937357dbede9439401be640fb7d17 ==> e3ad019e0011b04a480552a7051aaf4bb3bad605 (PR)
1. Check liveness of validators at old version: cb5d7c9615b937357dbede9439401be640fb7d17
compatibility::simple-validator-upgrade::liveness-check : committed: 12756.18 txn/s, latency: 2521.62 ms, (p50: 2600 ms, p70: 2700, p90: 3000 ms, p99: 4600 ms), latency samples: 418520
2. Upgrading first Validator to new version: e3ad019e0011b04a480552a7051aaf4bb3bad605
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 1225.41 txn/s, submitted: 1225.56 txn/s, expired: 0.15 txn/s, latency: 7187.46 ms, (p50: 7800 ms, p70: 8800, p90: 9100 ms, p99: 9200 ms), latency samples: 91769
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 4350.03 txn/s, latency: 7800.54 ms, (p50: 8700 ms, p70: 8800, p90: 9100 ms, p99: 9200 ms), latency samples: 153300
3. Upgrading rest of first batch to new version: e3ad019e0011b04a480552a7051aaf4bb3bad605
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 4459.46 txn/s, latency: 6969.39 ms, (p50: 7700 ms, p70: 8300, p90: 8600 ms, p99: 8700 ms), latency samples: 93280
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 4397.66 txn/s, latency: 7711.74 ms, (p50: 8700 ms, p70: 8700, p90: 9000 ms, p99: 9200 ms), latency samples: 155000
4. upgrading second batch to new version: e3ad019e0011b04a480552a7051aaf4bb3bad605
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 8145.68 txn/s, latency: 3739.36 ms, (p50: 4300 ms, p70: 4700, p90: 4800 ms, p99: 5100 ms), latency samples: 149900
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 8055.00 txn/s, latency: 4218.61 ms, (p50: 4600 ms, p70: 4700, p90: 5000 ms, p99: 5100 ms), latency samples: 269280
5. check swarm health
Compatibility test for cb5d7c9615b937357dbede9439401be640fb7d17 ==> e3ad019e0011b04a480552a7051aaf4bb3bad605 passed
Test Ok

@vgao1996 vgao1996 merged commit b8f4b98 into aptos-labs:main Jan 24, 2025
86 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants