You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/09/04 21:08:15 UTC

[GitHub] oliversalzburg opened a new issue #195: Nightly builds are sometimes broken

oliversalzburg opened a new issue #195: Nightly builds are sometimes broken
URL: https://github.com/apache/cordova-coho/issues/195
 
 
   I [talked about this on Slack](https://cordova.slack.com/archives/C068CHRJ5/p1535978572000100). The nightly build are sometimes broken.
   
   I believe that [the `readFile` call](https://github.com/apache/cordova-coho/blob/5d710a3bb1838d1e822ee0ed4f830374c6c4b180/src/versionutil.js#L134) is invoked and then [the `gitutil.pendingChangesExist()` call is made](https://github.com/apache/cordova-coho/blob/5d710a3bb1838d1e822ee0ed4f830374c6c4b180/src/versionutil.js#L166) right after. Both calls have asynchronous behavior, which introduces a race condition. I believe that this race condition is to blame for the random build failures.
   
   Looking around the file, there is [at least another case](https://github.com/apache/cordova-coho/blob/5d710a3bb1838d1e822ee0ed4f830374c6c4b180/src/versionutil.js#L134) of this pattern. There might be more in the module if this is a general oversight by the author.
   
   My suggestion is, given the generator/yield approach of the module, the workflow should be adapted to that or, for a smaller refactoring, the code should use `fs.readFileSync` instead. In the latter case, refactoring the code should be trivial. I could create a PR for that if there is consensus about the change.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org