Skip to content

Conversation

@aaron-steinfeld
Copy link
Contributor

Description

Currently if the server dies due to an uncaught exception, it's logged and the process goes on. Updating so uncaught exceptions cause process to quit.

@aaron-steinfeld aaron-steinfeld requested a review from a team as a code owner July 31, 2023 15:37
@github-actions
Copy link

github-actions bot commented Jul 31, 2023

Test Results

31 tests  ±0   31 ✔️ ±0   8s ⏱️ -2s
  9 suites ±0     0 💤 ±0 
  9 files   ±0     0 ±0 

Results for commit bd01828. ± Comparison against base commit 4e0c1b4.

♻️ This comment has been updated with latest results.

context.addServlet(new ServletHolder(new JVMDiagnosticServlet()), "/diags/*");

final Thread thread = new Thread(this::doStart);
thread.setUncaughtExceptionHandler(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The potential risk here is that there may be some exceptions that are ignorable today and uncaught that would lead to a server quit. IMO we should be fixing any such spots (And kube will recover for us in the interim)

try {
this.shutdown();
} catch (Exception e) {
// Ignore if failed to shut down
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Potentially. The shutdown method calls various shutdown hooks, which each service is able to define itself. If any happen to throw (which seems like it's possible especially given it can now be called before startup), we don't want them to actually prevent the shutdown from completing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Log or it would be too noisy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a noise volume concern, i was just concerned it would be misleading. Basically something has happened to cause the server to shutdown abnormally. If we hit more errors when trying to force that shutdown (from a server that may not have started in the first place), we don't want those to distract from the root cause.

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Merging #73 (bd01828) into main (4e0c1b4) will decrease coverage by 0.31%.
The diff coverage is 10.00%.

@@             Coverage Diff              @@
##               main      #73      +/-   ##
============================================
- Coverage     70.57%   70.27%   -0.31%     
  Complexity      106      106              
============================================
  Files            15       15              
  Lines           588      592       +4     
  Branches         32       32              
============================================
+ Hits            415      416       +1     
- Misses          154      157       +3     
  Partials         19       19              
Flag Coverage Δ
unit 70.27% <10.00%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...ertrace/core/serviceframework/PlatformService.java 68.04% <10.00%> (-1.86%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aaron-steinfeld aaron-steinfeld merged commit 2da3ce8 into main Jul 31, 2023
@aaron-steinfeld aaron-steinfeld deleted the exit-on-error branch July 31, 2023 17:56
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