mirror of
https://github.com/minio/minio.git
synced 2025-02-23 03:22:30 -05:00
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:
parent
2825294b7b
commit
95e4cbbfde
@ -2417,7 +2417,7 @@ func getServerInfo(ctx context.Context, pools, metrics bool, r *http.Request) ma
|
||||
Mode: string(mode),
|
||||
Domain: domain,
|
||||
Region: globalSite.Region(),
|
||||
SQSARN: globalEventNotifier.GetARNList(false),
|
||||
SQSARN: globalEventNotifier.GetARNList(),
|
||||
DeploymentID: globalDeploymentID(),
|
||||
Buckets: buckets,
|
||||
Objects: objects,
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ func printEventNotifiers() {
|
||||
return
|
||||
}
|
||||
|
||||
arns := globalEventNotifier.GetARNList(true)
|
||||
arns := globalEventNotifier.GetARNList()
|
||||
if len(arns) == 0 {
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user