mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Error if target went offline (#18221)
If target went offline while MinIO was down, error once while trying to send message. If target goes offline during MinIO server running, it already comes through ping() call and errors out if target offline. Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This commit is contained in:
parent
b32014549c
commit
5b9656374c
@ -379,6 +379,10 @@ func (h *Target) SendFromStore(key store.Key) (err error) {
|
|||||||
// Messages are queued in the disk if the store is enabled
|
// Messages are queued in the disk if the store is enabled
|
||||||
// If Cancel has been called the message is ignored.
|
// If Cancel has been called the message is ignored.
|
||||||
func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
||||||
|
if atomic.LoadInt32(&h.status) == statusOffline {
|
||||||
|
h.config.LogOnce(ctx, fmt.Errorf("target %s is offline", h.Endpoint()), h.Endpoint())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if atomic.LoadInt32(&h.status) == statusClosed {
|
if atomic.LoadInt32(&h.status) == statusClosed {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user