-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Gracefully shutdown VTGate instances #14219
Changes from 2 commits
84aa4e6
40aefe1
669ff43
5f6218f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1707,7 +1707,15 @@ func (c *Conn) IsMarkedForClose() bool { | |
return c.closing | ||
} | ||
|
||
func (c *Conn) IsShuttingDown() bool { | ||
return c.listener.shutdown.Load() | ||
} | ||
|
||
// GetTestConn returns a conn for testing purpose only. | ||
func GetTestConn() *Conn { | ||
return newConn(testConn{}) | ||
} | ||
|
||
func GetTestServerConn(listener *Listener) *Conn { | ||
return newServerConn(testConn{}, listener) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this function (and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to move it but it's not able find it then. Could it be that functions in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes functions in test files can only be used locally. They aren't exported. From the Internet -
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the function already says
Test
but maybe it is a good idea to add a comment something like -And I would move this function to the
conn_fake.go
file. That files defines thetestConn
struct too and it contains all the test code we keep in the package.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GuptaManan100 Thanks! I moved this and the other
GetTestConn()
function toconn_fake.go
.