Skip to content

Commit

Permalink
fic
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherednik committed Nov 1, 2024
1 parent 4d57263 commit 2b3d696
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
1 change: 0 additions & 1 deletion internal/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ func (p *Pool[PT, T]) getItem(ctx context.Context, preferredNodeID uint32) (item
if item := xsync.WithLock(&p.mu, func() PT { //nolint:nestif
return p.removeFirstIdle(preferredNodeID)
}); item != nil {

if item.IsAlive() {
info := xsync.WithLock(&p.mu, func() itemInfo[PT, T] {
info, has := p.index[item]
Expand Down
17 changes: 7 additions & 10 deletions internal/pool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,14 @@ func TestPool(t *testing.T) { //nolint:gocyclo
var newSessionCalled uint32
p := New[*testItem, testItem](rootCtx,
WithTrace[*testItem, testItem](defaultTrace),
WithCreateItemFunc(func(ctx context.Context, nodeId uint32) (*testItem, error) {
_ = ctx
WithCreateItemFunc(func(_ context.Context, nodeId uint32) (*testItem, error) {
newSessionCalled++
var (
v = testItem{
v: 0,
onNodeID: func() uint32 {
return nodeId
},
}
)
v := testItem{
v: 0,
onNodeID: func() uint32 {
return nodeId
},
}
return &v, nil

Check failure on line 267 in internal/pool/pool_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

return with no blank line before (nlreturn)
}),
)
Expand Down
4 changes: 2 additions & 2 deletions internal/query/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package query

import (
"context"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
balancerContext "github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
"time"

"github.com/ydb-platform/ydb-go-genproto/Ydb_Query_V1"
Expand All @@ -13,6 +11,8 @@ import (

"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/closer"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
balancerContext "github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/pool"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/config"
Expand Down
2 changes: 1 addition & 1 deletion internal/query/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ func testPool(
) *pool.Pool[*Session, Session] {
return pool.New[*Session, Session](ctx,
pool.WithLimit[*Session, Session](1),
pool.WithCreateItemFunc(func (ctx context.Context, _ uint32) (*Session, error) {
pool.WithCreateItemFunc(func(ctx context.Context, _ uint32) (*Session, error) {
return createSession(ctx)
}),
pool.WithSyncCloseItem[*Session, Session](),
Expand Down
4 changes: 2 additions & 2 deletions internal/table/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package table

import (
"context"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
balancerContext "github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"

"github.com/jonboulle/clockwork"
"github.com/ydb-platform/ydb-go-genproto/Ydb_Table_V1"
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
balancerContext "github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/pool"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
Expand Down

0 comments on commit 2b3d696

Please sign in to comment.