Opened 8 years ago

Closed 8 years ago

#8171 closed enhancement (fixed)

Facilitator tells proxies how often to poll

Reported by: dcf Owned by: aallai
Priority: Medium Milestone:
Component: Archived/Flashproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: #8172 Points:
Reviewer: Sponsor:


Flash proxies have a built-in hard-coded polling interval (currently 10 minutes). When we needed to change the polling interval, I pushed a new version of flashproxy.js (commits 49de7bf6 and 69d429db). They should rather get their polling interval from the facilitator. That is, in response to a polling request, the facilitator sends back


meaning, no client now, try again in 10 minutes. Send check-back-in even if the response contains a client.

The benefits of the facilitator controlling the polling interval are:

  • facilitator can dynamically change the interval to maintain a desired polling level
  • different intervals can be given to IPv4 and IPv6 proxies (we want IPv6 to poll faster because there are fewer of them)
  • we want to rate-limit polling (#7823) and it means changing policy in just one place (the facilitator) and not having to change proxy code at the same time to match.

The logic behind this needs to be in facilitator, not facilitator.cgi. In other words, facilitator.cgi sends to facilitator


and facilitator sends back




Dynamic changing of the polling interval is not part of this ticket. This ticket is only to hardcode 10 minutes in the facilitator and to make proxies obey it.

Child Tickets

Change History (6)

comment:1 Changed 8 years ago by dcf

Keywords: #8172 added

#8172 is about a dynamic polling interval, after this ticket is done.

comment:2 Changed 8 years ago by dcf

Keywords: #8172 removed
Parent ID: #8172

comment:3 Changed 8 years ago by aallai

Status: newneeds_review

Implemented at branch poll_interval.

The implementation makes the facilitator_poll_interval option obsolete, since it's ignored in favour of what the facilitator sends. I haven't removed the code or documentation for it though. Do we want to let people hosting the badge override what the facilitator says, using that option? 

comment:4 Changed 8 years ago by dcf

Status: needs_reviewneeds_revision

Good work on this. It's almost ready.

Don't make it an error in get_reg if the facilitator doesn't send CHECK-BACK-IN. It shouldn't be required. facilitator.cgi should cope with this situation by not sending back a check-back-in value.

Process the value in flashproxy.js with get_param_integer, not get_param_timespec.

Declare the local var poll_interval.

I want facilitator_poll_interval to override what the facilitator says in all cases. The global facilitator_poll_interval should not change once initialized.

if facilitator_poll_interval, use that
elseif check-back-in, use that

In all the above cases, take the max of what you decide and MIN_FACILITATOR_POLL_INTERVAL.

Bump DEFAULT_FACILITATOR_POLL_INTERVAL up to 1 hour--that case shouldn't happen unless there's a problem somewhere. Increase MIN_FACILITATOR_POLL_INTERVAL to 10 seconds.

If the proxy gets a nonsense check-back-in (get_param_integer returns null), log the error and fall back to DEFAULT_FACILITATOR_POLL_INTERVAL.

comment:5 Changed 8 years ago by aallai

Status: needs_revisionneeds_review

Javascript is a madman that will globalize anything that moves.

I've fixed up the poll_interval branch.

comment:6 Changed 8 years ago by dcf

Resolution: fixed
Status: needs_reviewclosed

Thanks, now committed.

Note: See TracTickets for help on using tickets.