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

Fix bug with hanged pseudoterminal #84181

Merged
merged 10 commits into from Nov 19, 2019
Merged

Fix bug with hanged pseudoterminal #84181

merged 10 commits into from Nov 19, 2019

Conversation

@solomatov
Copy link
Contributor

solomatov commented Nov 8, 2019

This PR fixes #84174
More time to initialize terminal as well as exponential backoff for wait periods.

@Tyriar Tyriar added this to the November 2019 milestone Nov 8, 2019
solomatov added 3 commits Nov 8, 2019
@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Nov 8, 2019

You can run these tests with ./scripts/test-integration.sh (or .bat). To skip the other integration tests you can change this:

To use suite.only (but we don't want to commit that).

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 8, 2019

@Tyriar It seems that finally I made the tests pass. Could you take a look? :-) Glad that you have the tests. When I made initial change, I didn't find them.

Also, what do you do if a build breaks. Is there a good way to clean everything? I have it all the time when I have yarn watch running, and change branches.

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 8, 2019

@Tyriar I also have a question for getting rid of delays in other place. There's this code:

	// TODO: This could be improved by using a single promise and resolve it when the terminal is ready
	private _getTerminalByIdEventually(id: number, retries: number = 5): Promise<ExtHostTerminal | undefined> {
		if (!this._getTerminalPromises[id]) {
			this._getTerminalPromises[id] = this._createGetTerminalPromise(id, retries);
		} else {
			this._getTerminalPromises[id].then(c => {
				return this._createGetTerminalPromise(id, retries);
			});
		}
		return this._getTerminalPromises[id];
	}

Do I understand correctly that the else branch does nothing useful? The then block is activated only if the terminal is found, and the value returned by then has no side effects.

@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Nov 8, 2019

Will try review soon

Is there a good way to clean everything? I have it all the time when I have yarn watch running, and change branches.

Typically we don't need to do anything here as TypeScript is pretty good at handling this. If I do get into this state I'll either delete out or nuke everything and start from scratch (git stash or commit then git clean -xfd).

Do I understand correctly that the else branch does nothing useful?

I think that was to restart retrying maybe? That TODO is actually talking about how I proposed we fix this; create a bunch of promises and store their resolves instead of using polling.

@solomatov solomatov closed this Nov 10, 2019
@solomatov solomatov deleted the solomatov:pty_bug branch Nov 10, 2019
@solomatov solomatov restored the solomatov:pty_bug branch Nov 10, 2019
@solomatov solomatov reopened this Nov 10, 2019
@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 12, 2019

@Tyriar Are there any updates on this? This fix is very important for us.

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 15, 2019

@Tyriar Any updates on this?

Tyriar added 4 commits Nov 17, 2019
@Tyriar
Tyriar approved these changes Nov 17, 2019
Copy link
Member

Tyriar left a comment

@solomatov I made some changes to simplify the PR. Let me know if this still looks good and if so I'll merge in.

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 17, 2019

@Tyriar You know this code definitely better than me, and your changes looks good to me, so feel free to merge.

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 18, 2019

@Tyriar Do you need help resolving this merge?

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 18, 2019

@Tyriar Remerged again, and hopefully, it will work well.

@solomatov

This comment has been minimized.

Copy link
Contributor Author

solomatov commented Nov 18, 2019

@Tyriar Seems merge worked this time.

@Tyriar Tyriar merged commit 96f91be into microsoft:master Nov 19, 2019
5 checks passed
5 checks passed
linux
Details
windows
Details
darwin
Details
VS Code #20191118.105 succeeded
Details
license/cla All CLA requirements met.
Details
@solomatov solomatov deleted the solomatov:pty_bug branch Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.