8000 Increase timeouts in debug mode by alexshtin · Pull Request #3542 · temporalio/temporal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Increase timeouts in debug mode #3542

8000
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

Merged
merged 3 commits into from
Oct 31, 2022
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ temporal-sql-tool: $(ALL_SRC)
@printf $(COLOR) "Build temporal-sql-tool with CGO_ENABLED=$(CGO_ENABLED) for $(GOOS)/$(GOARCH)..."
CGO_ENABLED=$(CGO_ENABLED) go build -o temporal-sql-tool ./cmd/tools/sql

temporal-server-debug: $(ALL_SRC)
@printf $(COLOR) "Build temporal-server-debug with CGO_ENABLED=$(CGO_ENABLED) for $(GOOS)/$(GOARCH)..."
CGO_ENABLED=$(CGO_ENABLED) go build -tags TEMPORAL_DEBUG -o temporal-server-debug ./cmd/server

##### Checks #####
copyright-check:
@printf $(COLOR) "Check license header..."
Expand Down
5 changes: 3 additions & 2 deletions client/admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ import (
"time"

"go.temporal.io/server/api/adminservice/v1"
"go.temporal.io/server/common/debug"
)

var _ adminservice.AdminServiceClient = (*clientImpl)(nil)

const (
// DefaultTimeout is the default timeout used to make calls
DefaultTimeout = 10 * time.Second
DefaultTimeout = 10 * time.Second * debug.TimeoutMultiplier
// DefaultLargeTimeout is the default timeout used to make calls
DefaultLargeTimeout = time.Minute
DefaultLargeTimeout = time.Minute * debug.TimeoutMultiplier
)

type clientImpl struct {
Expand Down
6 changes: 4 additions & 2 deletions client/frontend/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ import (
"time"

"go.temporal.io/api/workflowservice/v1"

"go.temporal.io/server/common/debug"
)

const (
// DefaultTimeout is the default timeout used to make calls
DefaultTimeout = 10 * time.Second
DefaultTimeout = 10 * time.Second * debug.TimeoutMultiplier
// DefaultLongPollTimeout is the long poll default timeout used to make calls
DefaultLongPollTimeout = time.Minute * 3
DefaultLongPollTimeout = time.Minute * 3 * debug.TimeoutMultiplier
)

var _ workflowservice.WorkflowServiceClient = (*clientImpl)(nil)
Expand Down
3 changes: 2 additions & 1 deletion client/history/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
replicationspb "go.temporal.io/server/api/replication/v1"
"go.temporal.io/server/common"
"go.temporal.io/server/common/convert"
"go.temporal.io/server/common/debug"
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"
serviceerrors "go.temporal.io/server/common/serviceerror"
Expand All @@ -49,7 +50,7 @@ var _ historyservice.HistoryServiceClient = (*clientImpl)(nil)

const (
// DefaultTimeout is the default timeout used to make calls
DefaultTimeout = time.Second * 30
DefaultTimeout = time.Second * 30 * debug.TimeoutMultiplier
)

type clientImpl struct {
Expand Down
5 changes: 3 additions & 2 deletions client/matching/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (

"go.temporal.io/server/api/matchingservice/v1"
"go.temporal.io/server/common"
"go.temporal.io/server/common/debug"
"go.temporal.io/server/common/dynamicconfig"
"go.temporal.io/server/common/namespace"
)
Expand All @@ -46,9 +47,9 @@ var _ matchingservice.MatchingServiceClient = (*clientImpl)(nil)

const (
// DefaultTimeout is the default timeout used to make calls
DefaultTimeout = time.Minute
DefaultTimeout = time.Minute * debug.TimeoutMultiplier
// DefaultLongPollTimeout is the long poll default timeout used to make calls
DefaultLongPollTimeout = time.Minute * 2
DefaultLongPollTimeout = time.Minute * 2 * debug.TimeoutMultiplier
)

type clientImpl struct {
Expand Down
2 changes: 2 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"go.temporal.io/server/common/authorization"
"go.temporal.io/server/common/build"
"go.temporal.io/server/common/config"
"go.temporal.io/server/common/debug"
"go.temporal.io/server/common/dynamicconfig"
"go.temporal.io/server/common/headers"
"go.temporal.io/server/common/log"
Expand Down Expand Up @@ -148,6 +149,7 @@ func buildCLI() *cli.App {
tag.NewStringTag("go-version", build.InfoData.GoVersion),
tag.NewBoolTag("cgo-enabled", build.InfoData.CgoEnabled),
tag.NewStringTag("server-version", headers.ServerVersion),
tag.NewBoolTag("debug-mode", debug.Enabled),
)

var dynamicConfigClient dynamicconfig.Client
Expand Down
4 changes: 3 additions & 1 deletion common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ package common
import (
"math"
"time"

"go.temporal.io/server/common/debug"
)

const (
Expand Down Expand Up @@ -83,7 +85,7 @@ const (

const (
// DefaultWorkflowTaskTimeout sets the Default Workflow Task timeout for a Workflow
DefaultWorkflowTaskTimeout = 10 * time.Second
DefaultWorkflowTaskTimeout = 10 * time.Second * debug.TimeoutMultiplier

// MaxWorkflowTaskStartToCloseTimeout sets the Max Workflow Task start to close timeout for a Workflow
MaxWorkflowTaskStartToCloseTimeout = 120 * time.Second
Expand Down
33 changes: 33 additions & 0 deletions common/debug/debug.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

//go:build TEMPORAL_DEBUG

package debug

const (
Enabled = true

TimeoutMultiplier = 100
)
33 changes: 33 additions & 0 deletions common/debug/not_debug.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

//go:build !TEMPORAL_DEBUG

package debug

const (
Enabled = false

TimeoutMultiplier = 1
)
3 changes: 2 additions & 1 deletion host/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ import (
"context"
"time"

"go.temporal.io/server/common/debug"
"go.temporal.io/server/common/rpc"
)

// NewContext create new context with default timeout 90 seconds.
func NewContext() context.Context {
ctx, _ := rpc.NewContextWithTimeoutAndVersionHeaders(90 * time.Second)
ctx, _ := rpc.NewContextWithTimeoutAndVersionHeaders(90 * time.Second * debug.TimeoutMultiplier)
return ctx
}
0