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

Increasing thrift's ServerConnectivityCheckInterval from 5ms to 100ms #1173

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions cmd/grpc.ext/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"path/filepath"
"time"

"github.com/apache/thrift/lib/go/thrift"
"github.com/go-kit/kit/log/level"
"github.com/kolide/kit/env"
"github.com/kolide/kit/logutil"
Expand Down Expand Up @@ -106,6 +107,8 @@ func main() {
logutil.Fatal(logger, "err", fmt.Errorf("starting grpc extension: %w", err), "stack", fmt.Sprintf("%+v", err))
}

thrift.ServerConnectivityCheckInterval = 100 * time.Millisecond

// create an extension server
server, err := osquery.NewExtensionManagerServer(
"com.kolide.grpc_extension",
Expand Down
3 changes: 3 additions & 0 deletions cmd/launcher.ext/launcher-extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"time"

"github.com/apache/thrift/lib/go/thrift"
"github.com/go-kit/kit/log/level"
"github.com/kolide/kit/logutil"
"github.com/kolide/kit/version"
Expand Down Expand Up @@ -35,6 +36,8 @@ func main() {
// allow for osqueryd to create the socket path
time.Sleep(2 * time.Second)

thrift.ServerConnectivityCheckInterval = 100 * time.Millisecond

// create an extension server
server, err := osquery.NewExtensionManagerServer(
"com.kolide.standalone_extension",
Expand Down
3 changes: 3 additions & 0 deletions cmd/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"strconv"
"time"

"github.com/apache/thrift/lib/go/thrift"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/kolide/kit/logutil"
Expand Down Expand Up @@ -56,6 +57,8 @@ const (
// rungroups with the various options, and goes! If autoupdate is
// enabled, the finalizers will trigger various restarts.
func runLauncher(ctx context.Context, cancel func(), opts *launcher.Options) error {
thrift.ServerConnectivityCheckInterval = 100 * time.Millisecond

logger := log.With(ctxlog.FromContext(ctx), "caller", log.DefaultCaller)

// If delay_start is configured, wait before running launcher.
Expand Down
1 change: 0 additions & 1 deletion pkg/osquery/interactive/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func buildOsqueryFlags(socketPath, augeasLensesPath string, osqueryFlags []strin
}

func loadExtensions(socketPath string, osquerydPath string) (*osquery.ExtensionManagerServer, error) {

extensionManagerServer, err := osquery.NewExtensionManagerServer(
extensionName,
socketPath,
Expand Down
3 changes: 3 additions & 0 deletions pkg/osquery/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"testing"
"time"

"github.com/apache/thrift/lib/go/thrift"
"github.com/go-kit/kit/log"
"github.com/kolide/kit/fsutil"
"github.com/kolide/kit/testutil"
Expand Down Expand Up @@ -46,6 +47,8 @@ func TestMain(m *testing.M) {

testOsqueryBinaryDirectory = filepath.Join(binDirectory, "osqueryd")

thrift.ServerConnectivityCheckInterval = 100 * time.Millisecond

if err := downloadOsqueryInBinDir(binDirectory); err != nil {
fmt.Printf("Failed to download osquery: %v\n", err)
os.Exit(1)
Expand Down