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

Fix a bug in peer-state-actions #4357

Merged
merged 13 commits into from
Feb 16, 2023

Conversation

coot
Copy link
Contributor

@coot coot commented Feb 10, 2023

Description

Fixed a bug in peer state actions: when demoting a peer from hot to warm the
monitoring loop might busy loop.

  • peer-state-actions: do not catch exceptions in the monitoring loop
  • peer-selection: filter out empty traces

Checklist

  • Branch
    • Commit sequence broadly makes sense
    • Commits have useful messages
    • The documentation has been properly updated
    • New tests are added if needed and existing tests are updated
    • Any changes affecting Consensus packages must have an entry in the appropriate changelog.d directory created using scriv. If in doubt, see the Consensus release process.
    • If this branch changes Network and has any consequences for downstream repositories or end users, said changes must be documented in interface-CHANGELOG.md
    • If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
  • Pull Request
    • Self-reviewed the diff
    • Useful pull request description at least containing the following information:
      • What does this PR change?
      • Why these changes were needed?
      • How does this affect downstream repositories and/or end-users?
      • Which ticket does this PR close (if any)? If it does, is it linked?
    • Reviewer requested

coot added 2 commits February 10, 2023 09:16
When the monitoring loop notices a hot to warm or cold demotion it
executes `deactivatePeerConnection` or `closePeerConnection` to make
sure all hot or hot & warm & established mini-protocols terminate.  Both
operations can throw, if they do they shutdown mux.  In this case we
should not continue running the monitoring loop but let it die,
otherwise we have a tight busy loop which will is eventually exited when
mux exits.
@coot coot requested a review from bolt12 February 10, 2023 08:23
@karknu
Copy link
Contributor

karknu commented Feb 10, 2023

LGTM.

@coot coot requested review from newhoggy and a team as code owners February 10, 2023 15:29
@coot coot force-pushed the coot/peer-state-actions-1.35 branch from eb3d180 to 8c86041 Compare February 10, 2023 15:36
@coot coot force-pushed the coot/peer-state-actions-1.35 branch from 8c86041 to 64e0c3c Compare February 10, 2023 16:16
@coot coot requested a review from nfrisby as a code owner February 13, 2023 08:47
@coot coot force-pushed the coot/peer-state-actions-1.35 branch from 349c1e5 to 5f2415f Compare February 14, 2023 08:40
@coot coot force-pushed the coot/peer-state-actions-1.35 branch from 5f2415f to 4afc515 Compare February 14, 2023 10:16
@coot coot requested a review from dnadales as a code owner February 14, 2023 10:16
@kevinhammond kevinhammond self-requested a review February 15, 2023 13:18
Copy link

@kevinhammond kevinhammond left a comment

Choose a reason for hiding this comment

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

Looks good.

@coot
Copy link
Contributor Author

coot commented Feb 15, 2023

Thank you @kevinhammond.

bors merge

iohk-bors bot added a commit that referenced this pull request Feb 15, 2023
4357: Fix a bug in peer-state-actions r=coot a=coot


# Description

Fixed a bug in peer state actions: when demoting a peer from hot to warm the
monitoring loop might busy loop.

- peer-state-actions: do not catch exceptions in the monitoring loop
- peer-selection: filter out empty traces

# Checklist

- Branch
    - [x] Commit sequence broadly makes sense
    - [x] Commits have useful messages
    - [ ] The documentation has been properly updated
    - [ ] New tests are added if needed and existing tests are updated
    - [ ] Any changes affecting Consensus packages must have an entry in the appropriate `changelog.d` directory created using [`scriv`](https://github.com/input-output-hk/scriv). If in doubt, see the [Consensus release process](../ouroboros-consensus/docs/ReleaseProcess.md).
    - [ ] If this branch changes Network and has any consequences for downstream repositories or end users, said changes must be documented in [`interface-CHANGELOG.md`](../docs/interface-CHANGELOG.md)
    - [ ] If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
- Pull Request
    - [x] Self-reviewed the diff
    - [ ] Useful pull request description at least containing the following information:
      - What does this PR change?
      - Why these changes were needed?
      - How does this affect downstream repositories and/or end-users?
      - Which ticket does this PR close (if any)? If it does, is it [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)?
    - [ ] Reviewer requested


Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: John Ky <john.ky@iohk.io>
Co-authored-by: Javier Sagredo <javier.sagredo@iohk.io>
Co-authored-by: Robin Stumm <robin.stumm@iohk.io>
Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
Co-authored-by: John Ky <newhoggy@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 15, 2023

Timed out.

@coot
Copy link
Contributor Author

coot commented Feb 15, 2023

bors merge

iohk-bors bot added a commit that referenced this pull request Feb 15, 2023
4357: Fix a bug in peer-state-actions r=coot a=coot


# Description

Fixed a bug in peer state actions: when demoting a peer from hot to warm the
monitoring loop might busy loop.

- peer-state-actions: do not catch exceptions in the monitoring loop
- peer-selection: filter out empty traces

# Checklist

- Branch
    - [x] Commit sequence broadly makes sense
    - [x] Commits have useful messages
    - [ ] The documentation has been properly updated
    - [ ] New tests are added if needed and existing tests are updated
    - [ ] Any changes affecting Consensus packages must have an entry in the appropriate `changelog.d` directory created using [`scriv`](https://github.com/input-output-hk/scriv). If in doubt, see the [Consensus release process](../ouroboros-consensus/docs/ReleaseProcess.md).
    - [ ] If this branch changes Network and has any consequences for downstream repositories or end users, said changes must be documented in [`interface-CHANGELOG.md`](../docs/interface-CHANGELOG.md)
    - [ ] If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
- Pull Request
    - [x] Self-reviewed the diff
    - [ ] Useful pull request description at least containing the following information:
      - What does this PR change?
      - Why these changes were needed?
      - How does this affect downstream repositories and/or end-users?
      - Which ticket does this PR close (if any)? If it does, is it [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)?
    - [ ] Reviewer requested


Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: John Ky <john.ky@iohk.io>
Co-authored-by: Javier Sagredo <javier.sagredo@iohk.io>
Co-authored-by: Robin Stumm <robin.stumm@iohk.io>
Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
Co-authored-by: John Ky <newhoggy@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 15, 2023

Timed out.

@coot
Copy link
Contributor Author

coot commented Feb 15, 2023

bors merge

iohk-bors bot added a commit that referenced this pull request Feb 15, 2023
4357: Fix a bug in peer-state-actions r=coot a=coot


# Description

Fixed a bug in peer state actions: when demoting a peer from hot to warm the
monitoring loop might busy loop.

- peer-state-actions: do not catch exceptions in the monitoring loop
- peer-selection: filter out empty traces

# Checklist

- Branch
    - [x] Commit sequence broadly makes sense
    - [x] Commits have useful messages
    - [ ] The documentation has been properly updated
    - [ ] New tests are added if needed and existing tests are updated
    - [ ] Any changes affecting Consensus packages must have an entry in the appropriate `changelog.d` directory created using [`scriv`](https://github.com/input-output-hk/scriv). If in doubt, see the [Consensus release process](../ouroboros-consensus/docs/ReleaseProcess.md).
    - [ ] If this branch changes Network and has any consequences for downstream repositories or end users, said changes must be documented in [`interface-CHANGELOG.md`](../docs/interface-CHANGELOG.md)
    - [ ] If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
- Pull Request
    - [x] Self-reviewed the diff
    - [ ] Useful pull request description at least containing the following information:
      - What does this PR change?
      - Why these changes were needed?
      - How does this affect downstream repositories and/or end-users?
      - Which ticket does this PR close (if any)? If it does, is it [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)?
    - [ ] Reviewer requested


Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: John Ky <john.ky@iohk.io>
Co-authored-by: Javier Sagredo <javier.sagredo@iohk.io>
Co-authored-by: Robin Stumm <robin.stumm@iohk.io>
Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
Co-authored-by: John Ky <newhoggy@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 16, 2023

Timed out.

@coot
Copy link
Contributor Author

coot commented Feb 16, 2023

bors merge

iohk-bors bot added a commit that referenced this pull request Feb 16, 2023
4357: Fix a bug in peer-state-actions r=coot a=coot


# Description

Fixed a bug in peer state actions: when demoting a peer from hot to warm the
monitoring loop might busy loop.

- peer-state-actions: do not catch exceptions in the monitoring loop
- peer-selection: filter out empty traces

# Checklist

- Branch
    - [x] Commit sequence broadly makes sense
    - [x] Commits have useful messages
    - [ ] The documentation has been properly updated
    - [ ] New tests are added if needed and existing tests are updated
    - [ ] Any changes affecting Consensus packages must have an entry in the appropriate `changelog.d` directory created using [`scriv`](https://github.com/input-output-hk/scriv). If in doubt, see the [Consensus release process](../ouroboros-consensus/docs/ReleaseProcess.md).
    - [ ] If this branch changes Network and has any consequences for downstream repositories or end users, said changes must be documented in [`interface-CHANGELOG.md`](../docs/interface-CHANGELOG.md)
    - [ ] If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
- Pull Request
    - [x] Self-reviewed the diff
    - [ ] Useful pull request description at least containing the following information:
      - What does this PR change?
      - Why these changes were needed?
      - How does this affect downstream repositories and/or end-users?
      - Which ticket does this PR close (if any)? If it does, is it [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)?
    - [ ] Reviewer requested


Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: John Ky <john.ky@iohk.io>
Co-authored-by: Javier Sagredo <javier.sagredo@iohk.io>
Co-authored-by: Robin Stumm <robin.stumm@iohk.io>
Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
Co-authored-by: John Ky <newhoggy@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 16, 2023

Timed out.

@coot coot merged commit 399da3a into release/cardano-node-1.35.x Feb 16, 2023
@coot coot deleted the coot/peer-state-actions-1.35 branch February 16, 2023 13:40
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.

7 participants