Skip to content
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

Osquerybeat: Change the query timeout from 3 secs to 60 secs #26775

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions x-pack/osquerybeat/beater/osquerybeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const (
// The interval in second for configuration refresh;
// osqueryd child process requests configuration from the configuration plugin implemented in osquerybeat
configurationRefreshIntervalSecs = 60

osqueryTimeout = 60 * time.Second
)

const (
Expand Down Expand Up @@ -176,7 +178,7 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {
// Create osqueryd client
cli := osqdcli.New(socketPath,
osqdcli.WithLogger(bt.log),
osqdcli.WithTimeout(3*time.Second),
osqdcli.WithTimeout(osqueryTimeout),
osqdcli.WithCache(cache, adhocOsqueriesTypesCacheSize),
)

Expand All @@ -201,7 +203,7 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {

// Start osquery extensions for logger and configuration
g.Go(func() error {
return runExtensionServer(ctx, socketPath, configPlugin, loggerPlugin)
return runExtensionServer(ctx, socketPath, configPlugin, loggerPlugin, osqueryTimeout)
})

// Register action handler
Expand Down Expand Up @@ -246,9 +248,9 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {
return g.Wait()
}

func runExtensionServer(ctx context.Context, socketPath string, configPlugin *ConfigPlugin, loggerPlugin *LoggerPlugin) (err error) {
func runExtensionServer(ctx context.Context, socketPath string, configPlugin *ConfigPlugin, loggerPlugin *LoggerPlugin, timeout time.Duration) (err error) {
// Register config and logger extensions
extserver, err := osquery.NewExtensionManagerServer(extManagerServerName, socketPath)
extserver, err := osquery.NewExtensionManagerServer(extManagerServerName, socketPath, osquery.ServerTimeout(timeout))
if err != nil {
return
}
Expand Down