-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Set timeout on splunk batch send #35496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Before this change, if the splunk endpoint is blocked it will cause a deadlock on `Close()`. This sets a reasonable timeout for the http request to send a log batch. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
@@ -63,6 +64,8 @@ const ( | |||
envVarStreamChannelSize = "SPLUNK_LOGGING_DRIVER_CHANNEL_SIZE" | |||
) | |||
|
|||
var batchSendTimeout = 30 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm changing it to a shorter timeout for tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Ping @anusha-ragunathan please take a look and see if it is OK. |
LGTM |
Set timeout on splunk batch send
Before this change, if the splunk endpoint is blocked it will cause a
deadlock on
Close()
.This sets a reasonable timeout for the http request to send a log batch.