[split] Var: prevent stale updates

A previous change removed the check for stale observers. This adds it
back, together with a unittest.

We also ensure that closes are done synchronously in flatMap. Though
this is safe -- as long as you are not creating your own custom Var
that does not close synchronously -- we may consider converting to an
asynchronous propagation model to allow for this.

RB_ID=297347
[split] TimeLike inSeconds should not truncate

RB_ID=297177
[split] Performance optimizations for Future.collect Motivation: Ian O'Connell found a performance bottleneck with Future.collect where it was using indexed access of the supplied Seq, as well as repeated calls to .size ?? Modifications: Use Seq.iterator.zipWithIndex and cache the size ?? Result: 7x performance improvement: BEFORE: 0% Scenario{vm=java, trial=0, benchmark=Collect} 1455028.78 ns; ??=405245.78 ns @ 10 trials AFTER: 0% Scenario{vm=java, trial=0, benchmark=Collect} 212045.66 ns; ??=5350.07 ns @ 10 trials

RB_ID=297553
[split] util: added updatedocs.bash to help automate updating the docs Motivation: Updating the docs requires a little bit of thought.  Ideally, we should be able to automate it, which requires being able to update the docs very simply.  A bash script which makes it a one liner will make it trivial.

Modifications:
Added updatedocs.bash to util/, stolen with some small modifications from finagle/pushsite.bash.

Results:
Can update the docs by just running a single script

RB_ID=293329
[split] Tagging a flaky test, see AWESOME-7746.

RB_ID=299301
TBR=true
NO-QUEUE=true
[split] util-app: Remove hardcoded ports in FlagTest

RB_ID=299321
TBR=true
[split] ForkJoin scheduler: first draft

A scheduler based on the JSR166y fork/join implementation. This
scheduler will balance tasks (via work stealing) across several
threads while retaining a target level of parallelism.

It also manages blocking, which is threaded through from Await; thus,
with this scheduler, applications can block with only a small penalty,
while avoiding the possibility of deadlock due to the parallelism
invariant ??? progress is guaranteed.

Currently, only future blocking is managed, this may be extended in
the future.

I think we can actually come up with a better work-stealing scheduler
for Finagle, but this is a good first approximation and has shown very
promising results in the adshards.

RB_ID=288821
[split] Event: mergeMap, not flatMap

Event's flatMap follows the definition of Var, but this is both
confusing and arguably wrong. This is further witnessed by the fact
that, were you to use flatMap with an aggregated Event, the aggregate
would be reset by each outer flatMap iteration.

Arguably, following the logic that an Event is a sequence-like
collection, flatMap should concatenate its inner Events. However,
Events are by definition unbounded. Thus I argue that there is no good
definiton of Event#flatMap.

However, we can define Event#mergeMap, which is the concurrent version
of the above -- instead of concatenating, we merge.

RB_ID=297875
[split] [3rdParty] Updating common_internal.zk-utils

Motivation:
The zk fix in c.t.c.zookeeper.client wasn't used by people transitively depending on it via an old version of common_internal.zookeeper-utils.

Modification:
Update everyone to the latest version of common_internal.zookeeper-utils

Result:
Everyone is using the latest c.t.c.zookeeper.client

RB_ID=299639
[split] Use ephemeral ports in all core library unit tests

Tests that hardcode ports tend to fail on CI machines. I grepped around our core
libraries and found a bunch of instances where we new up `InetSocketAddress`es
with known ports. This change makes use com.twitter.util.RandomSocket in all
such tests to make them use ephemeral ports.

RB_ID=299329
TBR=true
[split] util-app: Handle comma-separated values in `Flaggable.ofMap`

Without making the Flaggable grammar more complex (i.e. by introducing
semicolons), this change augments the Map-parsing function to support
comma-separated value strings. Thus if you comma-separate tokens that are meant
as Map values, they will be accumulated as comma-separated strings.

e.g. https://gist.github.com/evnm/39234993a1c4001db9fb

RB_ID=300345
[split] Implement application-level shutdown handling in App.

Motivations:
App currently implements onExit using Runtime.addShutdownHook. This comes with all sorts of baggage in terms of what can actually occur in a shutdown handler. For instance, logging and network resources cannot be relied upon in this context. In particular, this makes things like flushing a queue of work tricky.

Modifications:
Make App extend Closable so that it may be closed with a deadline.  ShutdownHandler now takes a Closable that is called before calling System.exit. The admin endpoints /quitquitquit & /admin/shutdown now take a 'grace' query parameter which can be used to control how long to give the App before calling System.exit. App.onExit no longer registers shutdown hooks via Runtime.addShutdownHook and instead manages a list of Closable "exits" which are closed when the app is closed.

Results:
When the application is shut down gracefully, onExit and postmain hooks will not run in the context of a VM shutdown hook; and they may therefore utilize, for example, logging and networked resources.

RB_ID=285287
[split] util-app: add usage string, printed before flags

RB_ID=270459
[split] Var.collect: Fix deadlock caused by oversynchronizing

RB_ID=304539
[split] flags: sort global flags in usage

RB_ID=305895
[split] release util version 6.13.0

RB_ID=309895
TBR=true