design: read config from cache

As jobs often ask for various parts of the configuration
in short sequence, we add a way to have those reads occur
from a cache in the job.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Support outdating a config

The config reader has a cached copy of the configuration.
Support marking it as outdated. In that way, we will later
be able to restrict reads to the case if we don't have
an up-to-date copy.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Outdate the config when waiting for locks

One of the reasons why jobs wait for locks is to avoid other
jobs modifying the same object. So, if we decide to wait for
locks, we cannot use our cached copy of the config any more.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Only read config if necessary

Make the ConfigWriter only rerequest the configuration if
it became outdated in the mean time. This will save unnecessary
traffic between jobs and WConfD.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Makefile.am: Don't use dots in -osuf

This fixes
  ./configure --enable-haskell-tests && make hs-tests
builds on GHC 7.8.

It changes `-osuf .ext` to `-osuf ext`; the old form was allowed in
GHC <= 7.6, but GHC 7.8 seems to have problems with it:
  https://ghc.haskell.org/trac/ghc/ticket/9760

The form without dot works in all GHC versions, and we don't have
dots in other -osuf arguments in the same file either, so this
was probably an accident.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>