Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S Snowflake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 71
    • Issues 71
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Anti-censorship
  • Pluggable Transports
  • Snowflake
  • Issues
  • #40021

Closed
Open
Created Nov 13, 2020 by Cecylia Bocovich@cohoshOwner

Break from infinite client-broker poll after call to snowflakes.End()

This bug was originally brought to my attention in #40018 (comment 2715140) but it's a more general issue than just for snowflake on mobile devices.

The following for loop in client/lib/webrtc.go will poll infinitely until it receives an available snowflake:

// exchangeSDP sends the local SDP offer to the Broker, awaits the SDP answer,
// and returns the answer.
func exchangeSDP(broker *BrokerChannel, offer *webrtc.SessionDescription) *webrtc.SessionDescription {
	// Keep trying the same offer until a valid answer arrives.
	for {
		// Send offer to broker (blocks).
		answer, err := broker.Negotiate(offer)
		if err == nil {
			return answer
		}
		log.Printf("BrokerChannel Error: %s", err)
		log.Printf("Failed to retrieve answer. Retrying in %v", ReconnectTimeout)
		<-time.After(ReconnectTimeout)
	}
}

Because of ongoing work on matching up clients with compatible proxies in #40013 (closed), we currently have almost no "unrestricted" proxies available, meaning snowflake clients behind restricted NATs have to poll for a very long time before getting a snowflake. Normally the potentially infinite polling isn't a problem as long as there are snowflakes available, but if the client makes a call to snowflakes.End() we should stop polling regardless of whether or not snowflakes are available.

Assignee
Assign to
Time tracking