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

increase conn killer check to double the tx timeout value #8649

Merged
merged 1 commit into from
Aug 23, 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: 5 additions & 5 deletions go/vt/vttablet/endtoend/connkilling/connkiller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestTxKillerKillsTransactionsInReservedConnections(t *testing.T) {
_, err := client.ReserveBeginExecute("select 42", nil, nil)
require.NoError(t, err)

assertIsKilledWithin5Seconds(t, client)
assertIsKilledWithin6Seconds(t, client)
}

func TestTxKillerDoesNotKillReservedConnectionsInUse(t *testing.T) {
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestTxKillerCountsTimeFromTxStartedNotStatefulConnCreated(t *testing.T) {
_, err = client.Execute("select 43", nil)
require.NoError(t, err)

assertIsKilledWithin5Seconds(t, client)
assertIsKilledWithin6Seconds(t, client)
}

func TestTxKillerKillsTransactionThreeSecondsAfterCreation(t *testing.T) {
Expand All @@ -83,7 +83,7 @@ func TestTxKillerKillsTransactionThreeSecondsAfterCreation(t *testing.T) {
_, err := client.BeginExecute("select 42", nil, nil)
require.NoError(t, err)

assertIsKilledWithin5Seconds(t, client)
assertIsKilledWithin6Seconds(t, client)
}

func assertIsNotKilledOver5Second(t *testing.T, client *framework.QueryClient) {
Expand All @@ -94,10 +94,10 @@ func assertIsNotKilledOver5Second(t *testing.T, client *framework.QueryClient) {
}
}

func assertIsKilledWithin5Seconds(t *testing.T, client *framework.QueryClient) {
func assertIsKilledWithin6Seconds(t *testing.T, client *framework.QueryClient) {
var err error
// when it is used once per second
for i := 0; i < 5; i++ {
for i := 0; i < 6; i++ {
_, err = client.Execute("select 43", nil)
if err != nil {
break
Expand Down