Closed (fixed)
Project:
Drush
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2012 at 09:09 UTC
Updated:
12 Jul 2012 at 18:21 UTC
Jump to comment: Most recent file
We are seeing a relatively high number of transients errors with packaging on Drupal.org. A typical session is:
ERROR: /usr/bin/php /var/www/drupal.org/tools/drush5/drush.php --no-cache --include=/var/www/drupal.org/tools/drupalorg_drush make --drupal-org=contrib --drupal-org-build-root=/var/tmp/branch.20167/commerce_kickstart --drupal-org-log-errors-to-file --drupal-org-log-package-metadata=metadata-contrib.json drupal-org.make . failed with status 1
>> Project omega contains 5 themes: omega, alpha, starterkit_omega_html5, starterkit_omega_xhtml, starterkit_alpha_xhtml.
>> Project custom_breadcrumbs contains 7 modules: custom_breadcrumbs_taxonomy, custom_breadcrumbsapi, custom_breadcrumbs_panels, custom_breadcrumbs_paths, custom_breadcrumbs_identifiers, custom_breadcrumbs_views, custom_breadcrumbs.
>> [... a lot of similar success messages ...]
ERROR: >> Unable to create /tmp/drush_tmp_1339675650_4fd9d402e4f3e.
ERROR: >> Project cs_adaptive_image (7.x-1.0-alpha2) could not be downloaded to /tmp/make_tmp_1339675649_4fd9d401ded3d/__build__/modules/contrib/cs_adaptive_image.
ERROR: Build for commerce_kickstart-7.x-2.x-dev-no-core failed.
Looking into it, there is an obvious race condition in drush_mkdir(), which currently read this way:
if (!is_dir($path)) {
if (drush_mkdir(dirname($path))) {
if (@mkdir($path)) {
return TRUE;
}
else {
// Error.
}
}
}
Drush Make working concurrently, it can happen that a process created the directory while another process was between !is_dir() and @mkdir.
I don't know if this is the root cause of our troubles, but it seems important to fix nonetheless.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1642532-drush-mkdir-race-condition.patch | 496 bytes | damien tournoud |
Comments
Comment #1
damien tournoud commentedI applied the following in production on drupal.org.
Comment #2
damien tournoud commentedFor reference, it doesn't seem that we have seen this issue since the patch was applied.
Comment #3
moshe weitzman commentedAnyone see a problem with this patch?
Comment #4
greg.1.anderson commentedIt seems okay to me. By inspection, I think that the race condition is eliminated in this patch. The mkdir will not fail unless another process has created the folder, and the subsequent checks should therefore always succeed.
Comment #5
moshe weitzman commentedCommitted