add activateEngine to app to handle multiple profiles a little more gracefully; lauchPeerConnections sorts based on last message time; contactRetry slow downs and partial state tracking of circuit queue for adaptive slow downs #462

Merged
dan merged 6 commits from connectionLogic into master 2022-12-04 07:04:48 +00:00
Owner
  • add activateEngine to app to handle multiple profiles a little more gracefully
  • StartConnections sorts based on last message time
  • contactRetry slow downs and partial state tracking of circuit queue for adaptive slow downs
  • also apparently gofmt app.go
- add activateEngine to app to handle multiple profiles a little more gracefully - StartConnections sorts based on last message time - contactRetry slow downs and partial state tracking of circuit queue for adaptive slow downs - also apparently gofmt app.go
dan force-pushed connectionLogic from afbf964c95 to b16f394be5 2022-12-03 00:42:07 +00:00 Compare
dan changed title from WIP add activateEngine to app to handle multiple profiles a little more gracefully; lauchPeerConnections sorts based on last message time; contactRetry slow downs and partial state tracking of circuit queue for adaptive slow downs to add activateEngine to app to handle multiple profiles a little more gracefully; lauchPeerConnections sorts based on last message time; contactRetry slow downs and partial state tracking of circuit queue for adaptive slow downs 2022-12-03 00:43:26 +00:00
dan force-pushed connectionLogic from b16f394be5 to 2e9c8e89ed 2022-12-03 00:44:32 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/61
dan force-pushed connectionLogic from 2e9c8e89ed to fb43db4b61 2022-12-03 01:16:23 +00:00 Compare
sarah reviewed 2022-12-03 01:19:56 +00:00
app/app.go Outdated
@ -245,2 +255,4 @@
}
func (app *application) ActivateEngine(doListen, doPeers, doServers bool) {
log.Infof("ActivateEngine")
Owner

debug

debug
dan marked this conversation as resolved
@ -247,0 +263,4 @@
if doListen {
for _, profile := range app.peers {
log.Infof(" Listen for %v", profile.GetOnion())
Owner

debug

debug
dan marked this conversation as resolved
app/app.go Outdated
@ -247,0 +267,4 @@
profile.Listen()
}
// give HS's a little start up lead time
time.Sleep(10 * time.Second)
Owner

seems unnecessary

seems unnecessary
dan marked this conversation as resolved
app/app.go Outdated
@ -247,0 +272,4 @@
if doPeers || doServers {
for _, profile := range app.peers {
log.Infof(" Start Connections for %v doPeers:%v doServers:%v", profile.GetOnion(), doPeers, doServers)
Owner

debug

debug
dan marked this conversation as resolved
@ -112,0 +258,4 @@
}
retryable := []*contact{}
count := atomic.LoadInt64(&cr.connCount)
Owner

why is an atomic necessary here...there is only one contact retry plugin per profile..

why is an atomic necessary here...there is only one contact retry plugin per profile..
dan marked this conversation as resolved
@ -816,3 +812,1 @@
time.Sleep(randWait * time.Second)
cp.eventBus.Publish(event.NewEvent(event.PeerRequest, map[event.Field]string{event.RemotePeer: onion}))
}()
log.Infof("PeerWithOnion go")
Owner

debug

debug
dan marked this conversation as resolved
@ -950,3 +971,4 @@
log.Debugf("using cached tokens for %v", ci.Handle)
}
log.Infof("Publish JoinServer Event")
Owner

debug

debug
dan marked this conversation as resolved
@ -1318,3 +1427,4 @@
cp.mutex.Lock()
cp.state[ev.Data[event.RemotePeer]] = connections.ConnectionStateToType()[ev.Data[event.ConnectionState]]
cp.mutex.Unlock()
log.Infof("Peer handle PeerStateChange for %v to %v", handle, ev.Data[event.ConnectionState])
Owner

debug

debug
dan marked this conversation as resolved
@ -138,6 +145,7 @@ func (e *engine) EventManager() event.Manager {
// eventHandler process events from other subsystems
func (e *engine) eventHandler() {
log.Infof("engine.EventHandler()...")
Owner

debug

debug
dan marked this conversation as resolved
@ -339,3 +347,3 @@
// needs to be run in a goroutine as will block on Open.
func (e *engine) peerWithOnion(onion string) {
log.Infof("engine.peerWithOnion(%v)", onion)
Owner

debug or delete

debug or delete
dan marked this conversation as resolved
@ -342,3 +350,4 @@
log.Debugf("Called PeerWithOnion for %v", onion)
if !e.isBlocked(onion) {
e.ignoreOnShutdown(e.peerConnecting)(onion)
log.Infof(" service.Connect(%v)", onion)
Owner

debug or delete

debug or delete
dan marked this conversation as resolved
@ -345,1 +353,4 @@
log.Infof(" service.Connect(%v)", onion)
connected, err := e.service.Connect(onion, e.createPeerTemplate())
if err != nil {
log.Errorf("peerWithOnion err form Connect: %v\n", err)
Owner

this should not be an error as connect is assumed to fail

this should not be an error as connect is assumed to fail
dan marked this conversation as resolved
dan force-pushed connectionLogic from fb43db4b61 to ad72ce6e7a 2022-12-03 17:26:54 +00:00 Compare
dan added 1 commit 2022-12-03 17:50:51 +00:00
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/65
dan force-pushed connectionLogic from 75f6ff96aa to 2a877ff408 2022-12-03 18:02:34 +00:00 Compare
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/66
dan force-pushed connectionLogic from 084403db0b to 5658e9aa9f 2022-12-03 18:39:31 +00:00 Compare
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/68
dan added 1 commit 2022-12-03 23:48:28 +00:00
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is pending Details
c8a6a1b079
contactRetry has protocol engine existence awareness (prep for turning profiles on/off)
sarah approved these changes 2022-12-03 23:57:00 +00:00
sarah left a comment
Owner

Approved pending buildbot

Approved pending buildbot
@ -145,3 +327,4 @@
pinf, _ := cr.connections.Load(id)
p := pinf.(*contact)
log.Infof(" managing state change for %v %v to %v by self %v", id, connections.ConnectionStateName[p.state], connections.ConnectionStateName[state], cr.onion)
Owner

debug

debug
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/69
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/70
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/72
dan merged commit c8a6a1b079 into master 2022-12-04 07:04:48 +00:00
Sign in to join this conversation.
No description provided.