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),
|
Mode: string(mode),
|
||||||
Domain: domain,
|
Domain: domain,
|
||||||
Region: globalSite.Region(),
|
Region: globalSite.Region(),
|
||||||
SQSARN: globalEventNotifier.GetARNList(false),
|
SQSARN: globalEventNotifier.GetARNList(),
|
||||||
DeploymentID: globalDeploymentID(),
|
DeploymentID: globalDeploymentID(),
|
||||||
Buckets: buckets,
|
Buckets: buckets,
|
||||||
Objects: objects,
|
Objects: objects,
|
||||||
|
@ -49,23 +49,18 @@ func NewEventNotifier(ctx context.Context) *EventNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetARNList - returns available ARNs.
|
// GetARNList - returns available ARNs.
|
||||||
func (evnot *EventNotifier) GetARNList(onlyActive bool) []string {
|
func (evnot *EventNotifier) GetARNList() []string {
|
||||||
arns := []string{}
|
arns := []string{}
|
||||||
if evnot == nil {
|
if evnot == nil {
|
||||||
return arns
|
return arns
|
||||||
}
|
}
|
||||||
region := globalSite.Region()
|
region := globalSite.Region()
|
||||||
for targetID, target := range evnot.targetList.TargetMap() {
|
for targetID := range evnot.targetList.TargetMap() {
|
||||||
// httpclient target is part of ListenNotification
|
// httpclient target is part of ListenNotification
|
||||||
// which doesn't need to be listed as part of the ARN list
|
// which doesn't need to be listed as part of the ARN list
|
||||||
// This list is only meant for external targets, filter
|
// This list is only meant for external targets, filter
|
||||||
// this out pro-actively.
|
// this out pro-actively.
|
||||||
if !strings.HasPrefix(targetID.ID, "httpclient+") {
|
if !strings.HasPrefix(targetID.ID, "httpclient+") {
|
||||||
if onlyActive {
|
|
||||||
if _, err := target.IsActive(); err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
arns = append(arns, targetID.ToARN(region).String())
|
arns = append(arns, targetID.ToARN(region).String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ func printEventNotifiers() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
arns := globalEventNotifier.GetARNList(true)
|
arns := globalEventNotifier.GetARNList()
|
||||||
if len(arns) == 0 {
|
if len(arns) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user