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 multiprocessing problems with setting __file__ #14376

Merged
merged 3 commits into from
Oct 12, 2020

Conversation

rchiodo
Copy link

@rchiodo rchiodo commented Oct 12, 2020

For #12530

We were setting the __file__ on every execution. This slows things down and actually can break the case as described in the bug. Since this was rather simple and the user in the bug is stuck on a specific version I sent him, figured I'd just fix this.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).
  • The wiki is updated with any design decisions/details.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

traceError('Failed to change kernel', exc);
// Throw a new exception indicating we cannot change.
throw new JupyterInvalidKernelError(kernelConnection);
if (exc instanceof JupyterWaitForIdleError) {
Copy link
Member

Choose a reason for hiding this comment

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

Related fix? Just something you noticed at the same time?

@@ -420,6 +421,38 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi
protected async closeBecauseOfFailure(_exc: Error): Promise<void> {
this.dispose();
}

protected async setFileInKernel(file: string, cancelToken: CancellationToken | undefined): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

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

You're right, even aside from fixing the bug seems better from a perf standpoint.

@rchiodo rchiodo merged commit dba5e37 into main Oct 12, 2020
@rchiodo rchiodo deleted the rchiodo/fix_multiprocessing branch October 12, 2020 21:05
luabud pushed a commit to luabud/vscode-python that referenced this pull request Oct 26, 2020
* Fix multiprocessing problems with setting __file__

* Update news entry

* Problem with wait for idle not propagating outwards
DonJayamanne pushed a commit that referenced this pull request Oct 30, 2020
* Fix two problems with escaping (#14228)

* Remove unneeded cell keys when exporting (#14241)

* Remove transient output when exporting from the interactive window

* Add news entry

* Test was failing with true jupyter (#14261)

* Potential fix for ipywidget flakiness (#14281)

* Try running tests with space in root path (#14113)

* Add test with a space (only works on flake)

* Push to insiders.yml only

* Remove test that doesn't really do anything

* REmove unused bits

* Change path to have unicode too

* Get test to run

* Set root path differently

* Valid dir

* A different way

* Another way

* Try creating the directory first

* Another try

* Only one env

* Pass parameters correctly

* Try without unicode

* Set working directory directly on xvfb actions

* Working-directory not workingDirectory

* Cached ts files output

* Remove test with space branch for insiders

* Update vscode-python-pr-validation.yaml (#14285)

REmove missing branch? Might make it work again

* Get rid of AZDO yamls. Not used anymore

* Dont run on push (#14307)

* Fix random failures on functional tests (#14331)

* Splitting test log

* Fix problem with kernels ports being reused

* Make kernel launcher port round robin only for testing

* Make formatters change only apply during testing

* Add news entry

* Apply black formatting

* Code review feedback and skip flakey remote password test

* Another flakey test

* More CR feedback

* Missed a spot

* More of the functional tests are failing (#14346)

* Splitting test log

* Fix problem with kernels ports being reused

* Make kernel launcher port round robin only for testing

* Make formatters change only apply during testing

* Add news entry

* Apply black formatting

* Code review feedback and skip flakey remote password test

* Another flakey test

* More CR feedback

* Missed a spot

* Some more log parser changes and try to get interrupt to be less flakey

* Fix interrupt killing kernel and add more logging for export

* More logging

* See if updating fixes the problem

* Dont delete temp files

* Upload webview output to figure out trust failure

* Add name to step

* Try another way to upload

* Upload doesn't seem to work

* Try a different way to upload

* Try without webview logging as this makes the test pass

* Try fixing test another way. Any logging is making the test pass

* Compile error

* Add more logging to figure out why raw kernel did not start (#14374)

* Some more logging

* Some more logging

* Move PR changes into pr.yml

* Fix multiprocessing problems with setting __file__ (#14376)

* Fix multiprocessing problems with setting __file__

* Update news entry

* Problem with wait for idle not propagating outwards

* Fix unnecessary ask for python extension install

* Don't error on warning for kernel install
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.

2 participants