-
Notifications
You must be signed in to change notification settings - Fork 323
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
Initialize suggestions database only once #8116
Initialize suggestions database only once #8116
Conversation
just a heads up, it might be useful to merge with develop, there's a fix that should make the lint CI less flaky |
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.
Just by reading the code, this looks fine. I'd like to play around with it a bit more in a live setting
.../language-server/src/main/java/org/enso/languageserver/boot/resource/RepoInitialization.java
Show resolved
Hide resolved
boolean isInitialized(); | ||
|
||
/** Initialize the component. */ | ||
CompletableFuture<Void> init(); |
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.
Shouldn't init
assume that isInitialized
is false
at the beginning of the execution?
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.
I implemented it in a higher-level initialization components
public Future<BoxedUnit> executeAsynchronously(RuntimeContext ctx, ExecutionContext ec) { | ||
return Future.apply( | ||
() -> { | ||
TruffleLogger logger = ctx.executionService().getLogger(); | ||
long writeCompilationLockTimestamp = ctx.locking().acquireWriteCompilationLock(); | ||
try { | ||
ctx.jobControlPlane().abortAllJobs(); | ||
ctx.jobControlPlane().abortBackgroundJobs(DeserializeLibrarySuggestionsJob.class); |
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.
Isn't this related to the random deserialization problems you were seeing?
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.
I think I've checked everything. It really shouldn't
...ent-common/src/main/scala/org/enso/interpreter/instrument/execution/JobExecutionEngine.scala
Outdated
Show resolved
Hide resolved
🚢 it. I haven't seen any initialization problems anymore. |
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.
Many classes were rewritten to Java. Nice.
/** Object indicating that the initialization is complete. */ | ||
public final class InitializationComponentInitialized { | ||
|
||
private static final class InstanceHolder { |
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.
There is no need for InstanceHolder
when the only method and INSTANCE
field of the InitializationComponentInitialized
class deal with holding and initializing the instance.
Pull Request Description
close #8033
Changelog:
getSuggestionDatabase
message handling in new IDEUniqueJob
to a marker interfaceImportant Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.