Skip to content

Conversation

@raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Apr 2, 2020

Key changes:

  • only register shutdown listeners when the app starts
    • it does not make sense to register shutdown listener before the app starts
    • starts to use system resources in the constructor is not a good idea
  • unregister process listeners upon explicit stop
  • fix the test case to clean up process listeners
  • improve debugging with context name prefix

Replace #5015

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@raymondfeng raymondfeng requested a review from deepakrkris as a code owner April 2, 2020 19:36
@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch from b62fdd4 to 2250d44 Compare April 2, 2020 21:24
@dhmlau dhmlau added this to the April 2020 milestone Apr 2, 2020
@raymondfeng raymondfeng added the Core @loopback/core label Apr 2, 2020
@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch 3 times, most recently from b9f4b42 to ee0df1e Compare April 3, 2020 00:34
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

This is much better than #5015 👏

I have few comments to consider, PTAL 👇

@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch from ee0df1e to ec6a75a Compare April 3, 2020 17:58
@raymondfeng raymondfeng requested a review from bajtos April 3, 2020 17:59
@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch 2 times, most recently from 6328a05 to c7956ef Compare April 7, 2020 00:10
@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch from c7956ef to 3629439 Compare April 7, 2020 16:55
@raymondfeng
Copy link
Contributor Author

@bajtos PTAL.

@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch from 3629439 to 4212146 Compare April 9, 2020 02:54
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

LGTM with one minor comment to consider. No further reviews are necessary as far as I am concerned.

Copy link
Contributor

@emonddr emonddr left a comment

Choose a reason for hiding this comment

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

approve, but one question about a particular import statement.

- only register shutdown listeners when the app starts
- unregister process listeners upon explicit stop
- fix the test case to clean up process listeners
- improve debugging with context name prefix
@raymondfeng raymondfeng force-pushed the improve-app-shutdown branch from 4212146 to c53833d Compare April 9, 2020 15:35
@raymondfeng raymondfeng merged commit 8086932 into master Apr 9, 2020
@raymondfeng raymondfeng deleted the improve-app-shutdown branch April 9, 2020 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core @loopback/core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants