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

Send executionComplete response only on success #7143

Merged
merged 6 commits into from
Jun 29, 2023

Conversation

hubertp
Copy link
Contributor

@hubertp hubertp commented Jun 27, 2023

Pull Request Description

executionFailed instead is sent when an evaulation finishes with a a critical failure or a non-critical error.
The PR tries to miniminally modify the change in the messages exchange so as to avoid a major redesign at this point.

Closes #7002.

Important Notes

Unblocks IDE which will need to modify to this new setup.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

- [ ] The documentation has been updated, if necessary.
- [ ] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.

  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

I'd expect some change in the protocol document - here is an idea:

Right now the protocol talks about executionFailed and executionComplete being sent from server to the client at "some undefined moment".

Shouldn't the document connect execution request with these two messages and claim that once an execution is started it is guaranteed that either executionFailed xor executionComplete is sent back to the client when the execution finishes?

I think this information is captured in the Runtime*Tests, but it might be useful to spell it out in the protocol specification as well.

@hubertp
Copy link
Contributor Author

hubertp commented Jun 28, 2023

I updated docs. I also replaced some Scala's case classes with case objects, as they should. Jackson needed a bit more configuration to be able to deal with them properly.

`executionFailed` instead is sent when an evaulation finishes with
a a critical failure or a non-critical error.
The PR tries to miniminally modify the change in the messages exchange
so as to avoid a major redesign at this point.

Closes #7002.
Jackson wasn't deserializing properly Scala's (case) objects by creating
new instances every time. That's the reason some definitions used
(improperly) Scala's case classes instead.
@hubertp hubertp force-pushed the wip/hubert/7002-execution-complete branch from 4785191 to a159a2a Compare June 28, 2023 10:53
Somehow incremental compilation didn't detect those.
Exchanges between IDE and LS are full of `executionFailed` "Execution of
function main interrupted" messages.
Those are part of regular execution and should be reported as failures.
mapper.registerModule(DefaultScalaModule)
mapper
.registerModule(DefaultScalaModule)
.registerModule(ScalaObjectDeserializerModule)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder, why it is a separate module and not a part of the Scala one.

Copy link
Contributor Author

@hubertp hubertp Jun 29, 2023

Choose a reason for hiding this comment

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

Yeah, clearly someone mixed that up

@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label Jun 29, 2023
@mergify mergify bot merged commit bf5ddf3 into develop Jun 29, 2023
@mergify mergify bot deleted the wip/hubert/7002-execution-complete branch June 29, 2023 07:35
mergify bot pushed a commit that referenced this pull request Jul 3, 2023
Package's config information, once loaded, never changed. While there is typically no need for it, this was problematic when the config became out-of-sync with the filesystem, like in the case of project rename action.
In rename, the config's properties would be updated in the FS, but that would never be reflected in module's package. Therefore further compilations would continue to ask for the old namespace.

Most of the changes are cosmetic (s/`.config`/`.getConfig()`) except for the new `reloadConfig` method on `Package` that is being called in `RenameProjectCmd` handler.

Closes #7062.

# Important Notes
The reported `ExecutionFailed` error should have been mostly fixed already via #7143. This change makes sure that all the related warnings are gone as well and the compiler uses the updated namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Engine should return executionComplete only in case of successful execution.
3 participants