-
Notifications
You must be signed in to change notification settings - Fork 758
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
Invalidate the environment in project when the compiler crashes #36492
Invalidate the environment in project when the compiler crashes #36492
Conversation
1f231f6
to
0cc0427
Compare
Codecov Report
@@ Coverage Diff @@
## 2201.1.x #36492 +/- ##
==============================================
+ Coverage 73.96% 74.00% +0.03%
- Complexity 48085 48236 +151
==============================================
Files 3215 3224 +9
Lines 187161 187678 +517
Branches 24459 24524 +65
==============================================
+ Hits 138442 138890 +448
- Misses 40686 40731 +45
- Partials 8033 8057 +24
Continue to review full report at Codecov.
|
|
||
// Check if the compiler crashed | ||
Collection<Diagnostic> errors = packageCompilation.diagnosticResult().errors(); | ||
if (errors != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this null check required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove it.
@@ -87,6 +92,11 @@ protected void setCurrentPackage(Package currentPackage) { | |||
} | |||
|
|||
public ProjectEnvironment projectEnvironmentContext() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we ensure that this method is invoked right after a compiler crash?
There can be places where we have cached compilerContext instances. If that's the case, then we will end up having multiple stale instances of compilerContext objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored the implementation as follows:
- Removed the crash recovery part from the Project API (which was added in the initial commit)
- Improved
Project.clearCaches
to reset the entire environment
The API user can call the Project.clearCaches
method when there is a crash.
5824835
to
6dd999f
Compare
6dd999f
to
9217211
Compare
Purpose
Approach
Check List