Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedir#529

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

ankostis
Copy link
Contributor

  • Do not abspath twice when constructing cloned repo.
  • Addgit.repo.base logger.

According to the TCs, the changes in this PR are OK.
@Byron is there any reason for not deleting this Window-only code-path about changing-cwd?

+ Do not abspath twice when contructing cloned repo.+ Add `git.repo.base` logger.
@codecov-io
Copy link

codecov-io commentedOct 11, 2016
edited
Loading

Current coverage is 93.97% (diff: 91.66%)

Merging#529 intomaster will increase coverage by0.13%

@@             master       #529   diff @@==========================================  Files            63         63            Lines          9628       9612    -16     Methods           0          0            Messages          0          0            Branches          0          0          ==========================================- Hits           9035       9033     -2+ Misses          593        579    -14  Partials          0          0

Powered byCodecov. Last update4b84602...cc6529c

@ankostis
Copy link
ContributorAuthor

Has already been merged in8ea7e26 with#530.

@ankostisankostis added this to thev2.1.0 - proper windows support milestoneOct 15, 2016
@ankostisankostis self-assigned thisOct 15, 2016
if progress:
handle_process_output(proc, None, progress.new_message_handler(), finalize_process)
else:
(stdout, stderr) = proc.communicate() # FIXME: Will block of outputs are big!
Copy link
Member

Choose a reason for hiding this comment

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

It's quite amazing thatcommunicate() actually cannot be trusted or is simply not implemented correctly :/.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Well, you are quite right -communicate() CAN be trusted.

I did a small experiment of reading a Gbyte, both in PY27 and PY35, and they do not block:

>>>importsubprocessassb>>>proc=sb.Popen('dd if=/dev/zero bs=1024 count=1000000',bufsize=0,stdin=sb.PIPE,stdout=sb.PIPE,stderr=sb.PIPE)>>>a,b=proc.communicate()

I don't remember when I got this mistrust forcommunicate(), maybe when I had tried PY33, or maybe when epxerimenting with interactive processes (like thegit.cmd.Git.cat-file persistent command); there thecomminicate() is not suitable because it will start consuming streams till the death of the process, but the process is awaiting for more input from python-side before ending, so it's a deadlock.

One or two changes in mywindows fixes were under this wrong assumption thatcommunicate() should not be trusted. But mostly I replaced code accessing directlyproc.stderr/stdout from the main thread - this is definitely freeze-prone code.

Copy link
Member

Choose a reason for hiding this comment

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

A nice experiment ! It doesn't seem to output both on stdout and stderr though, which might be causing the problem we see. Theimplementation of communicate looks asynchronous, but who knows what's hidden in the details.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Even whenstdout/stderr is interplexed,communicate() does not block (at least in PY3):

>>>importsubprocessassb>>>proc=sb.Popen(['python','-c',"import sys\nfor i in range(1000000):\n    print('a'*1024); print('b'*1024, file=sys.stderr)"],stdin=sb.PIPE,stdout=sb.PIPE,stderr=sb.PIPE)>>>%timea,b=proc.communicate()Walltime:48.3s>>>len(a),len(b)(1026000000,1026000000)

For some "unicode" reason cannot run the above experiment in PY2.

@Byron
Copy link
Member

@ankostis This looks like a massive simplification, which in any case is a good thing. Given that Appveyor will alert us of breakage, I think it is fine to go ahead with it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron left review comments

Assignees

@ankostisankostis

Development

Successfully merging this pull request may close these issues.

3 participants
@ankostis@codecov-io@Byron

[8]ページ先頭

©2009-2025 Movatter.jp