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

[plugin] support multiple windows per a backend #4521

Merged
merged 1 commit into from
Mar 14, 2019
Merged

[plugin] support multiple windows per a backend #4521

merged 1 commit into from
Mar 14, 2019

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Mar 11, 2019

fix #4509

In order to verify:

  • install any VS Code extension contributing language support (i used Go)
  • disable auto save
  • open several windows for the same file
  • add different APIs to this file for different windows
  • check that each window does not propose APIs from other windows (and has language support)

It's a breaking change: some plugin bindings are scoped per a connection now. Clients, who contribute/rebind these bindings, will need to scope them per a connection as well.

@akosyakov akosyakov changed the title [plugin] fix #4509: support multiple windows per a backend [plugin] support multiple windows per a backend Mar 11, 2019
@akosyakov
Copy link
Member Author

@ensorrow Could you try?

@akosyakov akosyakov force-pushed the GH-4509 branch 2 times, most recently from e27fdca to 7112b44 Compare March 11, 2019 09:24
Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

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

Works nicely

@benoitf
Copy link
Contributor

benoitf commented Mar 11, 2019

need more time for testing in all che configuration

@ensorrow
Copy link
Contributor

@ensorrow Could you try?

Works very nice!

@svenefftinge
Copy link
Contributor

need more time for testing in all che configuration

How long? The current state is seriously broken. So would be good to have this fixed ASAP.

@benoitf
Copy link
Contributor

benoitf commented Mar 12, 2019

@svenefftinge it is like this since the beginning and next release of theia is for the end of this month.
So I don't see the "hurry" there

@akosyakov
Copy link
Member Author

@benoitf There are our products which depend on next and can use it now. We are waiting for it.

Also PRs should not be stopped by testing all possible configurations of all using products. There should be self contained clients to test.

@benoitf
Copy link
Contributor

benoitf commented Mar 12, 2019

@akosyakov you're introducing breaking changes on something you didn't initiated. So please wait the reviewers. It's being one day. We waited from your on some PR for several weeks.

@akosyakov
Copy link
Member Author

akosyakov commented Mar 12, 2019

The point is that PRs can be reviewed by verifying master state against PR state for example apps, not end products. Which was done for this PR already twice. End products can migrate in 1 month as they pleased and report issues later.

We waited from your on some PR for several weeks.

It's not true, they were reviewed and did not work as before against example apps.

@svenefftinge
Copy link
Contributor

it is like this since the beginning

funny enough that no one noticed it so far, as it's a seriously bad bug and should be fixed ASAP.

and next release of theia is for the end of this month.

breaking changes should go onto master as early as possible, so downstream adopters can adjust.

So please have a look, this PR is only five files long.

@gorkem
Copy link
Contributor

gorkem commented Mar 12, 2019

The point is that PRs can be reviewed by verifying master state against PR state for example apps, not end products. Which was done for this PR already twice. End products can migrate in 1 month as they pleased and report issues later.

I am sorry but it is not fair to tell end products to migrate and report in a month while trying to rush a PR review for an end product. I already know that Florent has planned to test this after his current review of another PR is done and then he will provide his feedback, probably tomorrow. I do not think we should ask for rushing reviews for our products. There are already many ways to manage one of fixes to a downstream product, it is just unnecessary to expect contributors to work on your schedule.

@svenefftinge
Copy link
Contributor

svenefftinge commented Mar 12, 2019

Tomorrow is great.
In general, for critical bugs like this we should be able to prioritize accordingly.
Thanks for the info.

@akosyakov
Copy link
Member Author

akosyakov commented Mar 12, 2019

I am sorry but it is not fair to tell end products to migrate and report in a month while trying to rush a PR review for an end product.

I did not mean it. I said that end products should NOT be used for testing, but there should be internal clients (example apps or tests). It's a case for this PR: it was already tested by 2 persons against example apps. End products can migrate when they want and don't need to test anything immediately. Otherwise, it's like testing Eclipse RCP against some RCP product on each change. Does not make any sense and make turnaround super slow.

Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

hello, as there is not anymore 'last connected = winner', I've noticed that now there is a leak of plugin-host.js process.
Each restart spawn a new process but it is never terminated (when closing the browser window)

export function bindHostedBackend(bind: interfaces.Bind): void {
bindCommonHostedBackend(bind);
bind(ConnectionContainerModule).toConstantValue(hostedBackendConnectionModule);
Copy link
Contributor

Choose a reason for hiding this comment

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

hello, simple question, is that ConnectionContainerModule is handling the destroy of the instances associated to the scope ? (closing the browser tab is destroying the instances of this scope ) ?

Copy link
Member Author

@akosyakov akosyakov Mar 13, 2019

Choose a reason for hiding this comment

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

yes, it should, instances only exist within connection scope and can access each other (be injected)

Copy link
Member Author

Choose a reason for hiding this comment

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

closing the browser tab is destroying the instances of this scope

@svenefftinge it was my assumption. It could be good to implement, otherwise it could be hard to clean up without explicitly binding backend service.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes I assume we may have leaks on many items if instances are not destroyed/not notified ?

server.setClient(client);
// FIXME: handle multiple remote connections
/*
client.onDidCloseConnection(() => server.dispose());*/
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that server.dispose() would be useful in the new case (as we need to inform somehow that client is not connected if instances are not automatically destroyed ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be auto called when connection is closed, i wonder why it does not, will check

Copy link
Member Author

Choose a reason for hiding this comment

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

no, i am wrong, it is not auto disposed, this line is needed, checking again and pushing

@akosyakov
Copy link
Member Author

@benoitf should be good now, could you test again please

@benoitf
Copy link
Contributor

benoitf commented Mar 13, 2019

@akosyakov tested, fixed the issue but I will have to add a follow-up PR to propagate the clientClosed() event to pluginRunners else they're not notified that client is disconnected now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[plugin] support multiple remote connection of plugins
5 participants