Coder Social home page Coder Social logo

singchia / geminio Goto Github PK

View Code? Open in Web Editor NEW
83.0 83.0 26.0 1.08 MB

An application layer networking framework with rpc, bidirectional-rpc, multiplexer, raw-io and client-server consistency.

License: Apache License 2.0

Go 99.79% Makefile 0.21%
bidirectional-rpc c10k high-performance intranet-penetration long-connection multiplexer nat network-framework networking networking-programmability proxy rpc streaming tcp traversal

geminio's People

Contributors

dependabot[bot] avatar singchia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geminio's Issues

bug: panic in dialogue close which may be called after fini

stack:

goroutine 110119 [running]:
github.com/jumboframes/armorigo/synchub.(*SyncHub).Add(0x0, {0x56b2a0?, 0xc0461ea6f8}, {0xc009179ee8, 0x1, 0xc0052bc630?})
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/jumboframes/[email protected]/synchub/synchub.go:190 +0x179
github.com/jumboframes/armorigo/synchub.(*SyncHub).New(...)
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/jumboframes/[email protected]/synchub/synchub.go:175
github.com/singchia/geminio/multiplexer.(*dialogue).CloseWait.func1()
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/singchia/[email protected]/multiplexer/dialogue.go:645 +0xc5
github.com/singchia/geminio/pkg/sync.(*Once).doSlow(0x5092c0?, 0xc009120a10?)
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/singchia/[email protected]/pkg/sync/once.go:78 +0xbf
github.com/singchia/geminio/pkg/sync.(*Once).Do(...)
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/singchia/[email protected]/pkg/sync/once.go:66
github.com/singchia/geminio/multiplexer.(*dialogue).CloseWait(0xc0091319e0?)
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/singchia/[email protected]/multiplexer/dialogue.go:643 +0x3f
github.com/singchia/geminio/multiplexer.(*dialogueMgr).Close.func1(0xc009120a10?)
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/singchia/[email protected]/multiplexer/dialogue_mgr.go:433 +0x49
created by github.com/singchia/geminio/multiplexer.(*dialogueMgr).Close in goroutine 110118
	/Users/zhaizenghui/GOPATH/pkg/mod/github.com/singchia/[email protected]/multiplexer/dialogue_mgr.go:431 +0x1bb

source:

func (dg *dialogue) CloseWait() {
	// send close packet and wait for the end
	dg.closeOnce.Do(func() {
		pkt := dg.pf.NewDismissPacket(dg.dialogueID)
		dg.closewait = dg.shub.New(pkt.PacketID, synchub.WithTimeout(30*time.Second)) => BUG here
		dg.mtx.RLock()
		if !dg.dialogueOK {
			dg.mtx.RUnlock()
			return
		}

		dg.log.Debugf("dialogue is closing, clientID: %d, dialogueID: %d",
			dg.cn.ClientID(), dg.dialogueID)

		dg.writeInCh <- pkt
		dg.mtx.RUnlock()
		// the sync shouldn't be locked
		event := <-dg.closewait.C()
		if event.Error != nil {
			dg.log.Debugf("dialogue close wait err: %s, clientID: %d, peerDialogueID: %d, dialogueID: %d",
				event.Error, dg.cn.ClientID(), dg.peerNegotiatingID, dg.dialogueID)
			if event.Error == synchub.ErrSyncTimeout {
				// timeout and exit the dialogue
				dg.closeIO()
			}
			return
		}
		dg.log.Debugf("dialogue closed, clientID: %d, dialogueID: %d",
			dg.cn.ClientID(), dg.dialogueID)
		return
	})
}

bug: panic in synchub while geminio dialogue_mgr close

>>> panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x1292d39]

goroutine 38 [running]:
github.com/jumboframes/armorigo/synchub.(*SyncHub).Add(0x0, {0x1300780?, 0xc00033ce10}, {0xc00004d6e8, 0x1, 0xc00004d6b8?})
	github.com/jumboframes/[email protected]/synchub/synchub.go:190 +0x179
github.com/jumboframes/armorigo/synchub.(*SyncHub).New(...)
	github.com/jumboframes/[email protected]/synchub/synchub.go:175
github.com/singchia/geminio/multiplexer.(*dialogue).CloseWait.func1()
	github.com/singchia/[email protected]/multiplexer/dialogue.go:645 +0xc5
github.com/singchia/geminio/pkg/sync.(*Once).doSlow(0xc00004d768?, 0x1040f20?)
	github.com/singchia/[email protected]/pkg/sync/once.go:78 +0xbf
github.com/singchia/geminio/pkg/sync.(*Once).Do(...)
	github.com/singchia/[email protected]/pkg/sync/once.go:66
github.com/singchia/geminio/multiplexer.(*dialogue).CloseWait(0x12d7130?)
	github.com/singchia/[email protected]/multiplexer/dialogue.go:643 +0x3f
github.com/singchia/geminio/multiplexer.(*dialogueMgr).Close.func1(0xc0003b0000?)
	github.com/singchia/[email protected]/multiplexer/dialogue_mgr.go:428 +0x49
created by github.com/singchia/geminio/multiplexer.(*dialogueMgr).Close in goroutine 53
	github.com/singchia/[email protected]/multiplexer/dialogue_mgr.go:426 +0x1bb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.