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

feat: Notify application when a self-ISS event is detected by the platform #17274

Merged
merged 7 commits into from
Jan 9, 2025

Conversation

timfn-hg
Copy link
Contributor

@timfn-hg timfn-hg commented Jan 8, 2025

Description:
When a self or catastrophic ISS event is detected by the platform, forward the event to the application for additional handling. This PR creates a new ISS listener called AsyncFatalIssListener that compliments the existing IssListener. The new listener was created such that the event could be forwarded asynchronously, as opposed to synchronously with the original IssListener. If this async nature is not really wanted, then we can fall back to using the original IssListener (I think).

Currently, the handler that receives the notification doesn't do anything meaningful, but follow up work will expand its use.

Related issue(s):

Fixes #17266

Notes for reviewer:
I've updated the platform tests to ensure the notification is forwarded in the case of ISS events, but I am not familiar with how to test the full path between the platform and app layer to ensure the notification is being received (i.e. making sure the app pieces are set up correctly). If anyone can point me to how to do this, that would be great.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

…platform

Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
@timfn-hg timfn-hg self-assigned this Jan 8, 2025
@timfn-hg timfn-hg added this to the v0.59 milestone Jan 8, 2025
@timfn-hg timfn-hg changed the title feature: Notify application when a self-ISS event is detected by the platform feat: Notify application when a self-ISS event is detected by the platform Jan 8, 2025
Copy link

codacy-production bot commented Jan 8, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.11% (target: -1.00%) 66.67%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (66ebd29) 96103 68321 71.09%
Head commit (ef275a5) 96093 (-10) 68421 (+100) 71.20% (+0.11%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#17274) 9 6 66.67%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 67.34%. Comparing base (66ebd29) to head (ef275a5).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...node/app/state/listeners/FatalIssListenerImpl.java 60.00% 2 Missing ⚠️
...-app/src/main/java/com/hedera/node/app/Hedera.java 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17274      +/-   ##
============================================
+ Coverage     67.23%   67.34%   +0.10%     
- Complexity    21988    22021      +33     
============================================
  Files          2583     2584       +1     
  Lines         96320    96310      -10     
  Branches      10058    10054       -4     
============================================
+ Hits          64764    64860      +96     
+ Misses        27847    27741     -106     
  Partials       3709     3709              
Files with missing lines Coverage Δ
...a/com/hedera/node/app/platform/PlatformModule.java 100.00% <ø> (ø)
...lds/platform/builder/PlatformComponentBuilder.java 36.13% <ø> (ø)
...wirlds/platform/components/DefaultAppNotifier.java 100.00% <100.00%> (+100.00%) ⬆️
...-app/src/main/java/com/hedera/node/app/Hedera.java 52.27% <50.00%> (-0.02%) ⬇️
...node/app/state/listeners/FatalIssListenerImpl.java 60.00% <60.00%> (ø)

... and 26 files with indirect coverage changes

Impacted file tree graph

…fication to it in DefaultAppNotifier

Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
Copy link
Contributor

@anthony-swirldslabs anthony-swirldslabs left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Signed-off-by: Tim Farber-Newman <tim.farber-newman@swirldslabs.com>
Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM from services changes. Just had one comment. Thanks @timfn-hg!

Also, to test this you could simulate submitting self-ISS event locally in platform code and run node using ./gradlew run, submit some transactions. You should be able to see the warn log in hgcaa.log.

@timfn-hg timfn-hg merged commit 45f108d into main Jan 9, 2025
43 of 44 checks passed
@timfn-hg timfn-hg deleted the timfn/17266-notify-app-on-self-iss branch January 9, 2025 21:20
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.

Notify the application when an ISS occurs
5 participants