Skip to content

Commit 30ea984

Browse files
authored
[Bugfix] Fix backup creation timeout (#952)
1 parent 627f6f7 commit 30ea984

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- (Feature) Allow configuration for securityContext.runAsUser value
55
- (Bugfix) Fix Satellite collections in Agency
6+
- (Bugfix) Fix backup creation timeout
67

78
## [1.2.9](https://github.com/arangodb/kube-arangodb/tree/1.2.9) (2022-03-30)
89
- (Feature) Improve Kubernetes clientsets management

pkg/handlers/backup/arango_client_impl.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ func (ac *arangoClientBackupImpl) List() (map[driver.BackupID]driver.BackupMeta,
7575
}
7676

7777
func (ac *arangoClientBackupImpl) Create() (ArangoBackupCreateResponse, error) {
78-
ctx, cancel := context.WithTimeout(context.Background(), defaultArangoClientTimeout)
79-
defer cancel()
78+
dt := defaultArangoClientTimeout
8079

8180
co := driver.BackupCreateOptions{}
8281

@@ -86,9 +85,13 @@ func (ac *arangoClientBackupImpl) Create() (ArangoBackupCreateResponse, error) {
8685
}
8786
if timeout := opt.Timeout; timeout != nil {
8887
co.Timeout = time.Duration(*timeout * float32(time.Second))
88+
dt += co.Timeout
8989
}
9090
}
9191

92+
ctx, cancel := context.WithTimeout(context.Background(), dt)
93+
defer cancel()
94+
9295
id, resp, err := ac.driver.Backup().Create(ctx, &co)
9396
if err != nil {
9497
return ArangoBackupCreateResponse{}, err

0 commit comments

Comments
 (0)