Skip to content
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

net: move OnConnClose before Swap #277

Merged
merged 3 commits into from
May 12, 2023
Merged

Conversation

better0332
Copy link
Contributor

@better0332 better0332 commented May 12, 2023

What problem does this PR solve?

Issue Number: close None

Problem Summary:
move OnConnClose before Swap, because OnConnClose may call backendIO conn like ServerAddr()

What is changed and how it works:

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

…ackendIO conn like ServerAddr()

Signed-off-by: whl <wanghongliang@pingcap.com>
addr = backendIO.RemoteAddr().String()
connErr = backendIO.Close()
}
mgr.processLock.Unlock()

handErr := mgr.handshakeHandler.OnConnClose(mgr)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can just invoke OnConnClose before L639?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think OnHandshake is only called after the task is completed, and it also has processLock protection. just move before L639?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

…conn like ServerAddr()

Signed-off-by: whl <wanghongliang@pingcap.com>
…conn like ServerAddr()

Signed-off-by: whl <wanghongliang@pingcap.com>
@better0332 better0332 changed the title net: store nil backendIO after OnConnClose net: move OnConnClose before Swap May 12, 2023
@djshow832 djshow832 merged commit ea6ae2e into pingcap:main May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants