]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Use serial RGW Admin OPS API calls 31569/head
authorVolker Theile <vtheile@suse.com>
Thu, 23 May 2019 10:00:38 +0000 (12:00 +0200)
committerLaura Paduano <lpaduano@suse.com>
Tue, 12 Nov 2019 15:23:49 +0000 (16:23 +0100)
This PR takes care that changes done to a RGW user are submitted (via RGW Admin OPS API) in serial and NOT in parallel.

Fixes: https://tracker.ceph.com/issues/40015
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 2cc32e6e21d9aefd09d808d74c1b32a87fd3fbe0)

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts

index dc2b5bb49d053551c5e02cbf2786e6c2fea3d4bc..b3f096e9c1feaae8583542dd12434f0d4b82cee9 100644 (file)
@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
 import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { BsModalService } from 'ngx-bootstrap/modal';
-import { forkJoin as observableForkJoin, Observable } from 'rxjs';
+import { concat as observableConcat, forkJoin as observableForkJoin, Observable } from 'rxjs';
 
 import { RgwUserService } from '../../../shared/api/rgw-user.service';
 import { ActionLabelsI18n, URLVerbs } from '../../../shared/constants/app.constants';
@@ -238,17 +238,17 @@ export class RgwUserFormComponent implements OnInit {
       const bucketQuotaArgs = this._getBucketQuotaArgs();
       this.submitObservables.push(this.rgwUserService.updateQuota(uid, bucketQuotaArgs));
     }
-    // Finally execute all observables.
-    observableForkJoin(this.submitObservables).subscribe(
-      () => {
-        this.notificationService.show(NotificationType.success, notificationTitle);
-        this.goToListView();
-      },
-      () => {
+    // Finally execute all observables one by one in serial.
+    observableConcat(...this.submitObservables).subscribe({
+      error: () => {
         // Reset the 'Submit' button.
         this.userForm.setErrors({ cdSubmitButton: true });
+      },
+      complete: () => {
+        this.notificationService.show(NotificationType.success, notificationTitle);
+        this.goToListView();
       }
-    );
+    });
   }
 
   /**