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(extensions/#2484): Searching for extensions w/o network crashes Onivim #2551

Closed
wants to merge 4 commits into from

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Oct 6, 2020

Issue: When searching for extensions without a network connection, the editor would crash with:

(Invalid_argument Lwt.wakeup_exn)
Raised at file "stdlib.ml", line 30, characters 20-45
Called from file "src/process.ml", line 107, characters 12-54

Defect: There is a race condition here - we are waiting for EOF on stdout to return the promise - and claim success. However, in the error case, we'd get EOF on stdout, run Lwt.wakeup to complete the promise, and then get a call that the process has exited - and we'd call Lwt.wakeup_exn on the same promise. This triggers an invalid argument exception - we're trying to complete and then fail the same promise.

Fix: Wait until both the process has exited, and stdout has given the EOF - then we'll complete the promise. At that point, we know if the process was successful or failed, and we could do the appropriate action on the promise.

In addition, while debugging this, I saw that parsing was failing frequently when querying open-vsx - our parsing code was making the assumption that an icon field was always available, when that's not the case.

Finally, I also added an error message when the search query fails.

Fixes #2484 , and should fix #2545 as well

@bryphe bryphe changed the title fix(extensions/#2428): Searching for extensions w/o network crashes Onivim fix(extensions/#2484): Searching for extensions w/o network crashes Onivim Oct 6, 2020
@bryphe
Copy link
Member Author

bryphe commented Oct 6, 2020

Fixed branch name in #2552

@bryphe bryphe closed this Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant