File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -926,8 +926,13 @@ func (s *session) StreamReadTable(
926926 return nil , xerrors .WithStackTrace (err )
927927 }
928928
929- if checkHintSessionClose (stream .Trailer ()) {
930- s .SetStatus (options .SessionClosing )
929+ select {
930+ case <- stream .Context ().Done ():
931+ // nop
932+ default :
933+ if checkHintSessionClose (stream .Trailer ()) {
934+ s .SetStatus (options .SessionClosing )
935+ }
931936 }
932937
933938 return scanner .NewStream (
@@ -1010,8 +1015,13 @@ func (s *session) StreamExecuteScanQuery(
10101015 return nil , xerrors .WithStackTrace (err )
10111016 }
10121017
1013- if checkHintSessionClose (stream .Trailer ()) {
1014- s .SetStatus (options .SessionClosing )
1018+ select {
1019+ case <- stream .Context ().Done ():
1020+ // nop
1021+ default :
1022+ if checkHintSessionClose (stream .Trailer ()) {
1023+ s .SetStatus (options .SessionClosing )
1024+ }
10151025 }
10161026
10171027 return scanner .NewStream (
You can’t perform that action at this time.
0 commit comments