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

Cancel init or update workspace job of removed rootPaths #1064

Merged
merged 4 commits into from
Jun 18, 2019

Conversation

Poytr1
Copy link

@Poytr1 Poytr1 commented Jun 11, 2019

Signed-off-by: Poytr1 [email protected]

When we call java/didChangeWorkspaceFolders, we may remove some workspaces. However, when the removed workspace is still in the initialization phase, the initialize/update workspace job is still at WAITING status or RUNNING status. We have not canceled these jobs, and they will still execute in the background, occupying resources. The potential problem is that if I delete this workspace, I might get an exception from these jobs.
This PR is used to add a new family(rootpaths) for the initialize and update jobs, so that you can find these background workspace jobs for initializing the workspace based on removed rootpaths and try to cancel them.

@fbricon How do you think about this?

@fbricon fbricon requested a review from snjeza June 12, 2019 23:05
@snjeza
Copy link
Contributor

snjeza commented Jun 13, 2019

@Poytr1 Could you, please, add some unit tests?

@Poytr1
Copy link
Author

Poytr1 commented Jun 13, 2019

@Poytr1 Could you, please, add some unit tests?

@snjeza Sure, I will. I'm just want to make sure if this idea makes sense for you guys.

@Poytr1 Poytr1 force-pushed the pcxu_cancel_before_remove branch from de9c385 to aed1e27 Compare June 13, 2019 13:00
@Poytr1 Poytr1 force-pushed the pcxu_cancel_before_remove branch from 3bd5853 to 0594378 Compare June 13, 2019 15:14
@Poytr1
Copy link
Author

Poytr1 commented Jun 13, 2019

@snjeza Done!


@Before
public void setup() throws Exception {
server = new JDTLanguageServer(projectsManager, preferenceManager);
Copy link
Contributor

Choose a reason for hiding this comment

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

you need to store the workspace autobuilding value

Copy link
Author

Choose a reason for hiding this comment

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

done

server.disconnectClient();
JavaLanguageServerPlugin.getInstance().setProtocol(null);
try {
projectsManager.setAutoBuilding(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

restore workspace's initial autobuild value

Copy link
Author

Choose a reason for hiding this comment

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

done

@fbricon fbricon merged commit 7a11a57 into eclipse-jdtls:master Jun 18, 2019
@fbricon fbricon added this to the Mid July 2019 milestone Jun 18, 2019
@Poytr1 Poytr1 deleted the pcxu_cancel_before_remove branch June 19, 2019 01:29
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.

3 participants