Commit Graph

2423 Commits

Author SHA1 Message Date
CI
02c8aa1998 fnserver: 0.3.315 release [skip ci] 0.3.315 2018-01-31 12:13:33 +00:00
Dario Domizioli
e2dad00a83 Add simple test for calling several hot functions in parallel (#675)
* Add test for calling several hot functions in parallel
2018-01-31 12:08:05 +00:00
CI
5f8736500d fnserver: 0.3.314 release [skip ci] 0.3.314 2018-01-26 20:26:48 +00:00
Tolga Ceylan
97d78c584b fn: better slot/container/request state tracking (#719)
* fn: better slot/container/request state tracking
2018-01-26 12:21:11 -08:00
CI
a7223437df fnserver: 0.3.313 release [skip ci] 0.3.313 2018-01-24 17:36:52 +00:00
Travis Reeder
7ace234848 Cleaned up main readme a bit (#693)
* Cleaned up main readme a bit

* Update README.md
2018-01-24 09:31:28 -08:00
CI
cc4c157d56 fnserver: 0.3.312 release [skip ci] 0.3.312 2018-01-24 15:43:41 +00:00
Chad Arimura
43c9c5a5c5 remove some old non-fn assets that snuck in (#718) 2018-01-24 07:38:04 -08:00
CI
665997078e fnserver: 0.3.311 release [skip ci] 0.3.311 2018-01-24 03:57:41 +00:00
Reed Allman
bbd50a0e02 additional ctx spans / maid service (#716)
* add spans to async

* clean up / add spans to agent

* there were a few methods which had multiple contexts which existed in the same
scope (this doesn't end well, usually), flattened those out.
* loop bound context cancels now rely on defer (also was brittle)
* runHot had a lot of ctx shuffling, flattened that.
* added some additional spans in certain paths for added granularity
* linked up the hot launcher / run hot / wait hot to _a_ root span, the first
2 are follows from spans, but at least we can see the source of these and also
can see containers launched over a hot launcher's lifetime

I left TODO around the FollowsFrom because OpenCensus doesn't, at least at the
moment, appear to have any idea of FollowsFrom and it was an extra OpenTracing
method (we have to get the span out, start a new span with the option, then
add it to the context... some shuffling required). anyway, was on the fence
about adding at least.

* resource waiters need to manage their own goroutine lifecycle

* if we get an impossible memory request, bail instead of infinite loop

* handle timeout slippery case

* still sucks, but hotLauncher doesn't leak anything. even the time.After timer goroutines

* simplify GetResourceToken

GetCall can guard against the impossible to allocate resource tasks entering
the system by erroring instead of doling them out. this makes GetResourceToken
logic more straightforward for callers, who now simply have the contract that
they won't ever get a token if they let tasks into the agent that can't run
(but GetCall guards this, and there's a test for it).

sorry, I was going to make this only do that, but when I went to fix up the
tests, my last patch went haywire so I fixed that too. this also at least
tries to simplify the hotLaunch loop, which will now no longer leak time.After
timers (which were long, and with signaller, they were many -- I got a stack
trace :) -- this breaks out the bottom half of the logic to check to see if we
need to launch into its own function, and handles the cleaning duties only in
the caller instead of in 2 different select statements. played with this a
bit, no doubt further cleaning could be done, but this _seems_ better.

* fix vet

* add units to exported method contract docs

* oops
2018-01-23 19:52:22 -08:00
CI
ccd95b6f72 fnserver: 0.3.310 release [skip ci] 0.3.310 2018-01-24 03:35:45 +00:00
Tolga Ceylan
ee59361bda fn: added server too busy stats (#717) 2018-01-23 19:30:01 -08:00
CI
6873ed1fc1 fnserver: 0.3.309 release [skip ci] 0.3.309 2018-01-23 21:20:57 +00:00
Denis Makogon
a70c038760 New deps (#715) 2018-01-23 13:15:11 -08:00
CI
5fc01d6974 fnserver: 0.3.308 release [skip ci] 0.3.308 2018-01-22 22:23:01 +00:00
Denis Makogon
d3be603e54 Fnlb was moved to its own repo: fnproject/lb (#702)
* Fnlb was moved to its own repo: fnproject/lb

* Clean up fnlb leftovers

* Newer deps
2018-01-22 14:17:29 -08:00
CI
4ffa3d5005 fnlb: 0.0.268 release [skip ci] fnlb-0.0.268 2018-01-22 20:11:11 +00:00
CI
2fa754ff48 fnserver: 0.3.307 release [skip ci] 0.3.307 2018-01-22 20:09:10 +00:00
Reed Allman
899cc027b5 fixes header format in function file docs (#711)
closes #145
2018-01-22 12:02:14 -08:00
CI
46f57410c8 fnlb: 0.0.267 release [skip ci] fnlb-0.0.267 2018-01-22 19:50:37 +00:00
CI
81e015d008 fnserver: 0.3.306 release [skip ci] 0.3.306 2018-01-22 19:48:28 +00:00
Reed Allman
bae13d6c29 fix the http protocol dumper (#705)
we were using the httputil.DumpRequest when there is a perfectly good
req.Write method hanging out in the stdlib, that even does the chunked thing
that a few people ran into if they don't provide a content length:
https://golang.org/pkg/net/http/#Request.Write -- so we shouldn't run into
that issue again. I hit this in testing and it was not very fun to debug, so
added a test that repro'd it on master and fixes it here. of course, adding a
content length works too. tested this and it appears to work pretty well, also
cleaned up the control flow a little bit in http protocol.
2018-01-22 11:41:04 -08:00
CI
b4cdb09b0b fnlb: 0.0.266 release [skip ci] fnlb-0.0.266 2018-01-22 17:03:59 +00:00
CI
4d7c951f76 fnserver: 0.3.305 release [skip ci] 0.3.305 2018-01-22 17:02:09 +00:00
Nigel Deakin
e1df053de9 Change timedout to timeouts (#709) 2018-01-22 16:55:30 +00:00
CI
ab82a68424 fnlb: 0.0.265 release [skip ci] fnlb-0.0.265 2018-01-19 20:45:39 +00:00
CI
5c7a21b59e fnserver: 0.3.304 release [skip ci] 0.3.304 2018-01-19 20:43:29 +00:00
Tolga Ceylan
8c31e47c01 fn: agent slot improvements (#704)
*) Stopped using latency previous/current stats, this
was not working as expected. Fresh starts usually have
these stats zero for a long time, and initial samples
are high due to downloads, caches, etc.

*) New state to track: containers that are idle. In other
words, containers that have an unused token in the slot
queue.

*) Removed latency counts since these are not used in
container start decision anymore. Simplifies logs.

*) isNewContainerNeeded() simplified to use idle count
to estimate effective waiters. Removed speculative
latency based logic and progress check comparison.
In agent, waitHot() delayed signalling compansates
for these changes. If the estimation may fail, but
this should correct itself in the next 200 msec
signal.
2018-01-19 12:35:52 -08:00
CI
f2b15299d9 fnlb: 0.0.264 release [skip ci] fnlb-0.0.264 2018-01-19 18:11:46 +00:00
CI
31fd1276fb fnserver: 0.3.303 release [skip ci] 0.3.303 2018-01-19 18:09:40 +00:00
jan grant
d85e6bd61b Ensure we have the latest fnproject/dind (#687)
If we need to reissue fnproject/dind:17.12 (which fnproject/fnserver
is based upon) then let's make sure we're using the latest one
when cutting a release.

To ensure we don't accidentally use stale images lying around in
the docker cache (there probably shouldn't be *any*), call
    make clear-images
before running the build.
2018-01-19 10:02:25 -08:00
CI
d2e18b28fc fnlb: 0.0.263 release [skip ci] fnlb-0.0.263 2018-01-19 03:47:18 +00:00
CI
1549534c3c fnserver: 0.3.302 release [skip ci] 0.3.302 2018-01-19 03:45:21 +00:00
Reed Allman
333d07c58d add config placement info to docs (#703)
this behavior was recently cemented but was entirely omitted from the doc on
'how to write functions'
2018-01-18 15:00:32 -08:00
Tolga Ceylan
2f0de2b574 fn: resource and slot cancel and broadcast improvements (#696)
* fn: resource and slot cancel and broadcast improvements

*) Context argument does not wake up the waiters correctly upon
cancellation/timeout.
*) Avoid unnecessary broadcasts in slot and resource.

* fn: limit scope of context in resource/slot calls in agent
2018-01-18 13:43:56 -08:00
Reed Allman
c9e995292c if a slot is available, don't launch more (#701)
since we were sending a signal before checking if a slot was available, even
in the case of serial calls locally I was seeing 2 containers launch. if we
only send a signal after first checking if a slot is available, this goes
away. 1 usec should not be too offensive of an additional wait, all things
considered here.
2018-01-18 13:19:25 -08:00
CI
6662ed9c2a fnlb: 0.0.262 release [skip ci] fnlb-0.0.262 2018-01-18 00:18:23 +00:00
CI
3e2debae07 fnserver: 0.3.301 release [skip ci] 0.3.301 2018-01-18 00:16:12 +00:00
Tolga Ceylan
5a7778a656 fn: cancellations in WaitAsyncResource (#694)
* fn: cancellations in WaitAsyncResource

Added go context with cancel to wait async resource. Although
today, the only case for cancellation is shutdown, this cleans
up agent shutdown a little bit.

* fn: locked broadcast to avoid missed wake-ups

* fn: removed ctx arg to WaitAsyncResource and startDequeuer

This is confusing and unnecessary.
2018-01-17 16:08:54 -08:00
CI
7c74c2fe88 fnlb: 0.0.261 release [skip ci] fnlb-0.0.261 2018-01-17 15:26:04 +00:00
CI
65592c9d26 fnserver: 0.3.300 release [skip ci] 0.3.300 2018-01-17 15:23:53 +00:00
Travis Reeder
3f0518bd85 date change 2018-01-17 07:16:22 -08:00
CI
6892d209ea fnlb: 0.0.260 release [skip ci] fnlb-0.0.260 2018-01-16 22:54:30 +00:00
CI
88072eba6e fnserver: 0.3.299 release [skip ci] 0.3.299 2018-01-16 22:52:35 +00:00
Travis Reeder
5a2602d42e Updated docs, cleaned things up, DRY's up function format stuff. (#688)
* Updated docs, cleaned things up, DRY's up function format stuff.

* deleted files

* updated bad link
2018-01-16 14:45:44 -08:00
CI
e3a573d11a fnlb: 0.0.259 release [skip ci] fnlb-0.0.259 2018-01-15 16:44:57 +00:00
CI
f0aeb815b6 fnserver: 0.3.298 release [skip ci] 0.3.298 2018-01-15 16:42:49 +00:00
jan grant
1eb35abc63 Fix for MTU problems in some k8s environments (#685)
* NOTE: the fnproject/dind release will need recutting and the
  top-level Dockerfile updated to refer to it for this to be
  complete.

In many k8s environments the host docker uses an overlay network
which'll take bytes away from the effective MTU of outer
containers; eg, vxlan needs 50 bytes, often leaving a 1450 MTU
on the container running dind and fn-api.

In such an arrangement, packets exceeding the smaller MTU may be
invisibly dropped as they travel across the dind's docker0
bridge. This mostly surfaces as a failure of functions to be able
to reliably talk to external services. (Note, the failure may be
intermittent depending on the profile of the resulting TCP
communication.)

A robust fix for this is to intercept the startup of the dind
dockerd and ensure that /etc/docker/daemon.json (currently
absent) contains the following setting:

{
  "mtu": 1450
}

(or whatever the MTU on the external interface may be). This
should be autosized so the container works in a variety of
deployments.

The problem does not arise when using an embedded
/var/run/docker.sock - or when running with dind on a host that
can supply 1500-byte MTUs to containers on the 'host' docker.
2018-01-15 08:35:32 -08:00
CI
7626725d0e fnlb: 0.0.258 release [skip ci] fnlb-0.0.258 2018-01-15 14:58:01 +00:00
CI
02768f6539 fnserver: 0.3.297 release [skip ci] 0.3.297 2018-01-15 14:56:00 +00:00