aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

Return error if provided config was missing or invalid

Open banool opened this issue 2 years ago • 4 comments

Description

Currently if you pass in an explicit config path but there is no file at the path, or the config is missing, it just silently continues without even a warning. This PR makes it return an error in this case.

Test Plan

cargo run --release -p aptos -- node run-local-testnet --force-restart --config-path /tmp/does_not_exist.yaml --assume-yes

Output (when this PR is on top of https://github.com/aptos-labs/aptos-core/pull/5261):

Node stopped unexpectedly Err(
    Error {
        context: "Failed to load config at path: \"/tmp/does_not_exist.yaml\"",
        source: Unexpected(
            "Failed to open config file: \"/tmp/does_not_exist.yaml\". Error: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }",
        ),
    },
)
{
  "Error": "Unexpected error: One of the components stopped unexpectedly"
}

I checked and didn't see any location where we depend on the bad current behavior in our deployment code, and the CI will let us know if forge does.


This change is Reviewable

banool avatar Oct 24 '22 22:10 banool

Forge is running suite land_blocking on 71ab416eca330e39074f7e0736dcaccbd4cec5c3

github-actions[bot] avatar Oct 25 '22 00:10 github-actions[bot]

Forge is running suite compat on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 71ab416eca330e39074f7e0736dcaccbd4cec5c3

github-actions[bot] avatar Oct 25 '22 00:10 github-actions[bot]

:white_check_mark: Forge suite compat success on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 71ab416eca330e39074f7e0736dcaccbd4cec5c3

Compatibility test results for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 71ab416eca330e39074f7e0736dcaccbd4cec5c3 (PR)
1. Check liveness of validators at old version: 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7599 TPS, 5109 ms latency, 6800 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 71ab416eca330e39074f7e0736dcaccbd4cec5c3
compatibility::simple-validator-upgrade::single-validator-upgrade : 4898 TPS, 8330 ms latency, 11400 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 71ab416eca330e39074f7e0736dcaccbd4cec5c3
compatibility::simple-validator-upgrade::half-validator-upgrade : 4541 TPS, 9241 ms latency, 11300 ms p99 latency,no expired txns
4. upgrading second batch to new version: 71ab416eca330e39074f7e0736dcaccbd4cec5c3
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6542 TPS, 5844 ms latency, 10700 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 71ab416eca330e39074f7e0736dcaccbd4cec5c3 passed
Test Ok

github-actions[bot] avatar Oct 25 '22 00:10 github-actions[bot]

:white_check_mark: Forge suite land_blocking success on 71ab416eca330e39074f7e0736dcaccbd4cec5c3

performance benchmark with full nodes : 6866 TPS, 5788 ms latency, 8800 ms p99 latency,no expired txns
Test Ok

github-actions[bot] avatar Oct 25 '22 00:10 github-actions[bot]