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

Improve abstract InternalRuntime to be more flexible for recovery functionality #9345

Merged
merged 2 commits into from
Apr 11, 2018

Conversation

sleshchenko
Copy link
Member

@sleshchenko sleshchenko commented Apr 5, 2018

What does this PR do?

Improve abstract InternalRuntime to be more flexible for recovery functionality. It includes:

  • Add an ability to store status by an implementation of InternalRuntime. It allows infrastructure provide an actual status after runtime recovery. Also, it adds an ability to deny stopping of STARTING workspaces if it is not implemented like in Kubernetes/OpenShift infrastructures.
    Unfortunately, denying stop of STARTING workspace will not work correctly. Here is a registered bug for that Workspace is considered as STOPPED if start interruption is not implemented #9354.

  • Add an ability to throw InfrastructureException by InternalRuntimes#getMachines method. It is needed because Runtime may store machines information in storage that may throw some exceptions (like database as storage may throw connection related exceptions).

What issues does this PR fix or reference?

#5919
It's needed for OpenShift recovery functionality changes #9301

Release Notes

Docs PR

@sleshchenko sleshchenko self-assigned this Apr 5, 2018
@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/enhancement A feature request - must adhere to the feature request template. labels Apr 5, 2018
@sleshchenko sleshchenko force-pushed the spi-changes branch 2 times, most recently from ea2e431 to b0b5a3b Compare April 6, 2018 11:39
Copy link

@garagatyi garagatyi left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -144,16 +144,25 @@ public void validate(Environment environment)
*
* @param workspace the workspace to inject runtime into
*/
public void injectRuntime(WorkspaceImpl workspace) {
public void injectRuntime(WorkspaceImpl workspace) throws ServerException {

Choose a reason for hiding this comment

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

I'd rather use InfrastructureException. We have discussed that ServerException if rather REST exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that ServerException is REST exception, but InfrastructureException is an exception that is supposed to be thrown by Infrastructure. As you can see, now WorkspaceRuntimes throw only REST exceptions (Conflict, NotFound, Server).
I'd say that WorkspaceRuntimes should not throw REST exception but and Infrastructure exception isn't the right one here too. I guess there is an issue for reworking Che Master exception approach and this issue could be solved there.
@garagatyi Does it makes sense?

Choose a reason for hiding this comment

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

Yep, you are completely right. I missed that.

throws InfrastructureException;

/**
* Returns workspace status.

Choose a reason for hiding this comment

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

Runtime status or workspace status?

@sleshchenko
Copy link
Member Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9345
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@sleshchenko
Copy link
Member Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9345
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@sleshchenko
Copy link
Member Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9345
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@sleshchenko sleshchenko merged commit 692aeb6 into eclipse-che:master Apr 11, 2018
@sleshchenko sleshchenko deleted the spi-changes branch April 11, 2018 06:22
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Apr 11, 2018
@benoitf benoitf added this to the 6.4.0 milestone Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants