Skip to content

Commit

Permalink
Fix race conditions in starting adb
Browse files Browse the repository at this point in the history
Since we don't return the start-server exec promise, clients would run
more adb commands before the server was up. This would cause "Connection
Refused" to be returned to the second adb command, and everyone was
confused.

Actually returning the exec allows downstreams to wait on the server
starting.

Ref: ubports/ubports-installer#1847
  • Loading branch information
UniversalSuperBox committed Apr 14, 2021
1 parent 688cf3b commit e089e07
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/adb.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export class Adb extends Tool {
* @returns {Promise}
*/
startServer() {
return this.killServer().then(() => {
this.exec("start-server");
});
return this.killServer().then(() => this.exec("start-server"));
}

/**
Expand Down

0 comments on commit e089e07

Please sign in to comment.