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

Update nvda_dmp to possibly address an autoread hang #11998

Merged
merged 2 commits into from
Jan 11, 2021

Conversation

codeofdusk
Copy link
Contributor

Link to issue number:

Possible resolution for #11992.

Summary of the issue:

Currently, nvda_dmp sends the number of Unicode characters in the response header, then sends utf-8 encoded data. NVDA expects the header to contain the number of bytes, resulting in the diff hanging when the number of characters is fewer than the number of bytes.

Description of how this pull request fixes the issue:

nvda_dmp now sends the number of bytes (not characters) in the response header.

Testing performed:

I can no longer reproduce the hang described in #11992 and #11639 (comment) (I previously thought it was an issue with locking until further testing revealed this bug).

Known issues with pull request:

  • This PR definitely improves behaviour for me, but should be merged ASAP to allow for testing on master.

Change log entry:

None needed.

@codeofdusk
Copy link
Contributor Author

Cc @feerrenrut, @Neurrone.

@michaelDCurran michaelDCurran merged commit 04858db into nvaccess:master Jan 11, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone Jan 11, 2021
@codeofdusk codeofdusk deleted the update-dmp-20210111 branch January 11, 2021 23:36
@feerrenrut
Copy link
Contributor

From https://stackoverflow.com/a/54063928 I expected that at each "synchronization boundary" between NVDA and the DMP process there should be a call to flush, in both processes.

Eg if this code is sending some data and waiting for DMP to read it and respond, there should be a flush of std-out before the read. Otherwise you could end up with the DMP process waiting on extra data from NVDA, and NVDA waiting on data from DMP, therefore a deadlock.

@feerrenrut
Copy link
Contributor

So for instance after line 80 DiffMatchPatch._proc.stdin.write(new)

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.

4 participants