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

refactor getty module #746

Merged
merged 26 commits into from
Dec 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d84f3c0
feat:add more linter
No-SilverBullet Nov 10, 2024
aaae50c
Merge pull request #1 from No-SilverBullet/feat/add_linter
No-SilverBullet Nov 10, 2024
0fc667d
feat:change golangclilint version to 1.57.x to support more linter
No-SilverBullet Nov 10, 2024
6a4bebe
Merge pull request #2 from No-SilverBullet/feat/add_linter
No-SilverBullet Nov 10, 2024
358f4ac
feat:adjust lint conf and adjust the code to pass the check
No-SilverBullet Nov 10, 2024
ac85f94
Merge pull request #3 from No-SilverBullet/feat/add_linter
No-SilverBullet Nov 10, 2024
5c23b6c
Merge branch 'master' into master
luky116 Dec 7, 2024
fd25729
Merge branch 'master' into master
luky116 Dec 7, 2024
202cd26
Merge branch 'master' into master
luky116 Dec 7, 2024
eb16366
Merge branch 'apache:master' into master
No-SilverBullet Dec 13, 2024
f20acfe
style: format some code; fix: some sql statement or rows was not been…
No-SilverBullet Dec 13, 2024
ce334f7
feat:close session when send heart beat message failed
No-SilverBullet Dec 13, 2024
758a214
Merge pull request #4 from No-SilverBullet/feat/check_session_alive
No-SilverBullet Dec 13, 2024
5add578
Merge pull request #5 from No-SilverBullet/refactor/format
No-SilverBullet Dec 13, 2024
00bce0b
Merge branch 'apache:master' into master
No-SilverBullet Dec 16, 2024
5f2e225
refactor: change GettyRemoting from singleton to GettyRemotingClient …
solisamicus Dec 19, 2024
10bf844
remove rpc client
marsevilspirit Dec 19, 2024
b92d5bf
Merge branch 'master' into refactor/getty
marsevilspirit Dec 19, 2024
a4a789f
refactor: complete GettyRemoting refactoring
solisamicus Dec 19, 2024
265e45e
refactor: change getter name, improve variable naming and remove unus…
solisamicus Dec 20, 2024
b54d4b7
update something
marsevilspirit Dec 20, 2024
f5f72b6
Merge pull request #9 from marsevilspirit/refactor/getty
No-SilverBullet Dec 20, 2024
a4caadb
feat:add heart-beat failed retry times
No-SilverBullet Dec 20, 2024
dd541f8
Merge pull request #8 from No-SilverBullet/refactor/getty
No-SilverBullet Dec 20, 2024
001e49c
Refactor getty.
No-SilverBullet Dec 20, 2024
51d1cae
Refactor getty.
No-SilverBullet Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat:close session when send heart beat message failed
  • Loading branch information
No-SilverBullet committed Dec 13, 2024
commit ce334f70a6c22144338c5851ec7bde3d1396a241
10 changes: 7 additions & 3 deletions pkg/remoting/getty/listener.go
Original file line number Diff line number Diff line change
@@ -115,18 +115,22 @@ func (g *gettyClientHandler) OnMessage(session getty.Session, pkg interface{}) {

func (g *gettyClientHandler) OnCron(session getty.Session) {
log.Debug("session{%s} Oncron executing", session.Stat())
g.transferBeatHeart(session, message.HeartBeatMessagePing)
err := g.transferHeartBeat(session, message.HeartBeatMessagePing)
if err != nil {
log.Errorf("failed to send heart beat: {%#v}", err.Error())
g.sessionManager.releaseSession(session)
}
}

func (g *gettyClientHandler) transferBeatHeart(session getty.Session, msg message.HeartBeatMessage) {
func (g *gettyClientHandler) transferHeartBeat(session getty.Session, msg message.HeartBeatMessage) error {
rpcMessage := message.RpcMessage{
ID: int32(g.idGenerator.Inc()),
Type: message.GettyRequestTypeHeartbeatRequest,
Codec: byte(codec.CodecTypeSeata),
Compressor: 0,
Body: msg,
}
GetGettyRemotingInstance().SendASync(rpcMessage, session, nil)
return GetGettyRemotingInstance().SendASync(rpcMessage, session, nil)
}

func (g *gettyClientHandler) RegisterProcessor(msgType message.MessageType, processor processor.RemotingProcessor) {
Loading