File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,10 @@ func (core *sessionCore) deleteSession(ctx context.Context) (finalErr error) {
240240 defer cancel ()
241241 }
242242
243+ if err := ctx .Err (); err != nil {
244+ return xerrors .WithStackTrace (err )
245+ }
246+
243247 _ , err := core .Client .DeleteSession (ctx ,
244248 & Ydb_Query.DeleteSessionRequest {
245249 SessionId : core .id ,
Original file line number Diff line number Diff line change @@ -357,6 +357,10 @@ func newTableSession( //nolint:funlen
357357 status : table .SessionReady ,
358358 onClose : []func (s * Session ) error {
359359 func (s * Session ) error {
360+ if err := ctx .Err (); err != nil {
361+ return xerrors .WithStackTrace (err )
362+ }
363+
360364 _ , err = s .client .DeleteSession (ctx ,
361365 & Ydb_Table.DeleteSessionRequest {
362366 SessionId : s .id ,
@@ -471,13 +475,13 @@ func (s *Session) ID() string {
471475 return s .id
472476}
473477
474- func (s * Session ) Close (ctx context.Context ) (err error ) {
478+ func (s * Session ) Close (ctx context.Context ) (finalErr error ) {
475479 onDone := trace .TableOnSessionDelete (s .config .Trace (), & ctx ,
476480 stack .FunctionID ("github.com/ydb-platform/ydb-go-sdk/v3/internal/table.(*Session).Close" ),
477481 s ,
478482 )
479483 defer func () {
480- onDone (err )
484+ onDone (finalErr )
481485 s .SetStatus (table .SessionClosed )
482486 }()
483487
You can’t perform that action at this time.
0 commit comments