Commit 4c728eda authored by baldwinlouie's avatar baldwinlouie Committed by Yas Naoi
Browse files

Issue #3315797 by baldwinlouie, yas: Fix hanging process when reassigning UID...

Issue #3315797 by baldwinlouie, yas: Fix hanging process when reassigning UID to OpenStack cloud service providers
parent 6e87dfa1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -673,12 +673,19 @@ function aws_cloud_create_or_update_pricing_spreadsheet(CloudConfig $cloud_confi
 * Implements hook_cloud_config_update().
 */
function aws_cloud_cloud_config_update(CloudConfig $cloud_config): void {
  // Only perform resource update if coming from the cloud service provider
  // edit form.  This hook can be triggered during user_delete().  user_delete()
  // runs in progressive batch mode and `aws_cloud_cloud_config_update()` will
  // try to run a second non-progressive batch mode.  This confuses Drupal
  // and the original batch processing will never complete, causing the
  // site to hang.
  if ($cloud_config->bundle() === 'aws_cloud'
  && !aws_cloud_cloud_configs_equal(
    $cloud_config,
    $cloud_config->original,
    ['changed', 'field_spreadsheet_pricing_url', 'field_system_vpc']
  )) {
  )
  && \Drupal::routeMatch()->getRouteName() === 'entity.cloud_config.edit_form') {
    // Update resources.
    aws_cloud_update_ec2_resources($cloud_config);
  }
+6 −0
Original line number Diff line number Diff line
@@ -84,6 +84,12 @@ function k8s_help($route_name, RouteMatchInterface $route_match): string {
 * Implements hook_cloud_config_update().
 */
function k8s_cloud_config_update(CloudConfig $cloud_config): void {
  // Only perform resource update if coming from the cloud service provider
  // edit form.  This hook can be triggered during user_delete().  user_delete()
  // runs in progressive batch mode and `k8s_cloud_config_update()` will
  // try to run a second non-progressive batch mode.  This confuses Drupal
  // and the original batch processing will never complete, causing the
  // site to hang.
  if ($cloud_config->bundle() === 'k8s'
    && \Drupal::routeMatch()->getRouteName() === 'entity.cloud_config.edit_form') {
    // Update resources.
+8 −1
Original line number Diff line number Diff line
@@ -205,7 +205,14 @@ function openstack_cloud_config_delete(CloudConfig $cloud_config): void {
 * Implements hook_cloud_config_update().
 */
function openstack_cloud_config_update(CloudConfig $cloud_config): void {
  if ($cloud_config->bundle() === 'openstack') {
  // Only perform resource update if coming from the cloud service provider
  // edit form.  This hook can be triggered during user_delete().  user_delete()
  // runs in progressive batch mode and `openstack_update_resources()` will
  // try to run a second non-progressive batch mode.  This confuses Drupal
  // and the original batch processing will never complete, causing the
  // site to hang.
  if ($cloud_config->bundle() === 'openstack'
    && \Drupal::routeMatch()->getRouteName() === 'entity.cloud_config.edit_form') {
    openstack_update_resources($cloud_config);
  }
}