Do not ping event targets during cluster initialization (#19959)

S3 operations are frozen during startup, therefore we should avoid pinging
event targets during the initialization since it can stall.
This commit is contained in:
Anis Eleuch
2024-06-20 15:46:02 +01:00
committed by GitHub
parent 2825294b7b
commit 95e4cbbfde
3 changed files with 4 additions and 9 deletions

View File

@@ -49,23 +49,18 @@ func NewEventNotifier(ctx context.Context) *EventNotifier {
}
// GetARNList - returns available ARNs.
func (evnot *EventNotifier) GetARNList(onlyActive bool) []string {
func (evnot *EventNotifier) GetARNList() []string {
arns := []string{}
if evnot == nil {
return arns
}
region := globalSite.Region()
for targetID, target := range evnot.targetList.TargetMap() {
for targetID := range evnot.targetList.TargetMap() {
// httpclient target is part of ListenNotification
// which doesn't need to be listed as part of the ARN list
// This list is only meant for external targets, filter
// this out pro-actively.
if !strings.HasPrefix(targetID.ID, "httpclient+") {
if onlyActive {
if _, err := target.IsActive(); err != nil {
continue
}
}
arns = append(arns, targetID.ToARN(region).String())
}
}