Skip to content

Commit 4dfa164

Browse files
aleksmausmergify-bot
authored andcommitted
Osquerybeat: Change the query timeout from 3 secs to 60 secs (#26775)
* The 3 seconds timeout was too low for wifi_survey query for example which was taking more like 5 seconds on the test box. Bumping the value up eliminited timeouts. (cherry picked from commit 1754f54)
1 parent 2b75dd7 commit 4dfa164

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

x-pack/osquerybeat/beater/osquerybeat.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ const (
4646
// The interval in second for configuration refresh;
4747
// osqueryd child process requests configuration from the configuration plugin implemented in osquerybeat
4848
configurationRefreshIntervalSecs = 60
49+
50+
osqueryTimeout = 60 * time.Second
4951
)
5052

5153
const (
@@ -176,7 +178,7 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {
176178
// Create osqueryd client
177179
cli := osqdcli.New(socketPath,
178180
osqdcli.WithLogger(bt.log),
179-
osqdcli.WithTimeout(3*time.Second),
181+
osqdcli.WithTimeout(osqueryTimeout),
180182
osqdcli.WithCache(cache, adhocOsqueriesTypesCacheSize),
181183
)
182184

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

202204
// Start osquery extensions for logger and configuration
203205
g.Go(func() error {
204-
return runExtensionServer(ctx, socketPath, configPlugin, loggerPlugin)
206+
return runExtensionServer(ctx, socketPath, configPlugin, loggerPlugin, osqueryTimeout)
205207
})
206208

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

249-
func runExtensionServer(ctx context.Context, socketPath string, configPlugin *ConfigPlugin, loggerPlugin *LoggerPlugin) (err error) {
251+
func runExtensionServer(ctx context.Context, socketPath string, configPlugin *ConfigPlugin, loggerPlugin *LoggerPlugin, timeout time.Duration) (err error) {
250252
// Register config and logger extensions
251-
extserver, err := osquery.NewExtensionManagerServer(extManagerServerName, socketPath)
253+
extserver, err := osquery.NewExtensionManagerServer(extManagerServerName, socketPath, osquery.ServerTimeout(timeout))
252254
if err != nil {
253255
return
254256
}

0 commit comments

Comments
 (0)