Skip to content
Snippets Groups Projects

Issue #3243600: ProcessFactory can cause a race condition

1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
65 88 * The path which should be used as COMPOSER_HOME.
66 89 */
67 90 private function getComposerHomePath(): string {
68 /** @var \Drupal\Core\File\FileSystemInterface $file_system */
69 $file_system = \Drupal::service('file_system');
70 $home_path = $file_system->getTempDirectory() . '/automatic_updates_composer_home';
71 if (!is_dir($home_path)) {
72 mkdir($home_path);
73 }
91 $home_path = $this->fileSystem->getTempDirectory();
92 $home_path .= '/automatic_updates_composer_home-';
93 $home_path .= $this->configFactory->get('system.site')->get('uuid');
94 $this->fileSystem->prepareDirectory($home_path, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
  • Comment on lines +92 to +94

    So it looks like we can't prove the original caused a random failure but the original code would probably cause a different problem.

    If there were 2 totally different Drupal sites on the same server and they both did updates at the same time, which is likely if they were both reacting to new security updates, then as it is now they would both use the the same path for COMPOSER_HOME. It seems like it would better if each site used their own directory. It also likely that there are many servers running many more than just 2 different Drupal sites.

    so I think we should fix this for that reason.

  • Please register or sign in to reply
  • merged

  • Please register or sign in to reply
    Loading