-
Notifications
You must be signed in to change notification settings - Fork 128
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
support add fd parallelly #719
Conversation
There is no more a need to do that for AddFd over a unix socket connection (finally tapmanager is now internal to virtlet process goroutine) and @ivan4th will provide shortly a PR in which this part of code will be changed. Still unix domain sockets will be used for tapmanger<->vmwrapper communication so this fix can be relevant. |
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.
Reviewed 1 of 1 files at r1.
Reviewable status: 0 of 2 LGTMs obtained
pkg/tapmanager/fdserver.go, line 429 at r1 (raw file):
} func (c *FDClient) connect() (*net.UnixConn, error) {
There is no need to return there conn
as it can be set in c.conn
already, so in Connect
there will be also no need to assign conn
to c.conn
and do the error checking, as whole 6 lines added to Connect
can then be replaced by single return c.connect()
.
pkg/tapmanager/fdserver.go, line 443 at r1 (raw file):
// Close closes the connection to FDServer func (c *FDClient) close(conn *net.UnixConn) error {
Above suggested change would mean that this one is unnecessary...
pkg/tapmanager/fdserver.go, line 453 at r1 (raw file):
func (c *FDClient) request(hdr *fdHeader, data []byte) (*fdHeader, []byte, []byte, error) { conn, err := c.connect() if err != nil {
... also combining these 2 lines...
pkg/tapmanager/fdserver.go, line 456 at r1 (raw file):
return nil, nil, nil, errors.New("not connected") } defer c.close(conn)
... with there call to defer c.conn.Close()
so rest of changes in this func from c.conn
to conn
will also be unnecessary.
Maybe we should wait for @ivan4th 's new PR at first:) |
/HOLD |
7de9cc3
to
aeae06d
Compare
There is no need to export Connect() function to user, I remove it. |
create new connect for every fd request Signed-off-by: yanxuean <[email protected]>
aeae06d
to
b2ef8cb
Compare
@jellonek PTAL |
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.
Thanks for the PR!
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @yanxuean and @ivan4th)
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.
Reviewed 5 of 5 files at r2.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @yanxuean and @ivan4th)
@jellonek PTAL |
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.
Reviewable status: 1 change requests, 1 of 2 approvals obtained (waiting on @yanxuean)
create new connect for every fd request
Signed-off-by: yanxuean [email protected]
virtletv1.0
hit a problem.
The request and response of AddFd will be mismatch when we create plenty of pod(e.g. 10).
This change is