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
No reviewers
Labels
No Label
applications
BLOCKED
bug
design
duplicate
enhancement
fixed?
funding-needed
help wanted
infrastructure
invalid
payments
qubes
question
ready-for-implementation
refactor
spam
tapir-server
testing
tor
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cwtch.im/cwtch#462
Loading…
Reference in New Issue
No description provided.
Delete Branch "connectionLogic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
afbf964c95
tob16f394be5
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 downsto 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 downsb16f394be5
to2e9c8e89ed
Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/61
2e9c8e89ed
tofb43db4b61
@ -245,2 +255,4 @@
}
func (app *application) ActivateEngine(doListen, doPeers, doServers bool) {
log.Infof("ActivateEngine")
debug
@ -247,0 +263,4 @@
if doListen {
for _, profile := range app.peers {
log.Infof(" Listen for %v", profile.GetOnion())
debug
@ -247,0 +267,4 @@
profile.Listen()
}
// give HS's a little start up lead time
time.Sleep(10 * time.Second)
seems unnecessary
@ -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)
debug
@ -112,0 +258,4 @@
}
retryable := []*contact{}
count := atomic.LoadInt64(&cr.connCount)
why is an atomic necessary here...there is only one contact retry plugin per profile..
@ -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")
debug
@ -950,3 +971,4 @@
log.Debugf("using cached tokens for %v", ci.Handle)
}
log.Infof("Publish JoinServer Event")
debug
@ -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])
debug
@ -138,6 +145,7 @@ func (e *engine) EventManager() event.Manager {
// eventHandler process events from other subsystems
func (e *engine) eventHandler() {
log.Infof("engine.EventHandler()...")
debug
@ -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)
debug or delete
@ -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)
debug or delete
@ -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)
this should not be an error as connect is assumed to fail
fb43db4b61
toad72ce6e7a
Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/65
75f6ff96aa
to2a877ff408
Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/66
084403db0b
to5658e9aa9f
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/68
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)
debug
Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/69
Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/70
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/72