Commit Graph
1460 Commits
Author SHA1 Message Date
Matthias Radestock 1275bb24e5 exclude stale info from ConnectionMaker.String()
This got broken in 7bd0f7dbae.
2015-04-12 12:23:32 +01:00
Matthias Radestock 6409a8647c simplify connection logic slightly
There is no need to remove entries from cm.targets that are in
ourConnectedTargets. None of these targets will be in validTargets
(since addTarget filters anything in ourConnectedTargets), so they
will be removed a few lines further down anyway...

Unless the target is in the 'attempting' state. But that is ok, and in
fact desirable. Any such targets indicate connection attempts that are
in progress, which is something we display in `weave status` and want
to be accurate. Eventually the connection attempt will either succeed
or fail, and the cm.targets entry will be removed on the next run of
connectToTargets.
2015-04-12 12:11:27 +01:00
Matthias Radestock 21102d3615 refactor: extract router configuration
the param list of NewRouter was getting a bit long
2015-04-12 10:46:46 +01:00
Matthias Radestock e89e3adc69 cosmetic: more consistent param/arg/var ordering re Port 2015-04-12 10:45:49 +01:00
Matthias Radestock 065b632f91 significantly reduce time for test dns servers to shut down
by setting the ReadTimeout to 100ms instead of the default 2s.

Closes #547.
2015-04-11 20:52:51 +01:00
Matthias Radestock e0bba10ead better handling of test multicast listener initialisation errors
We handle that error explicitly in all cases and point out the common
cause, namely the absence of a default multicast interface.

Closes #481.
2015-04-11 20:22:41 +01:00
Matthias Radestock bb99b21248 tiny refactor: make use of helper function 2015-04-11 19:09:41 +01:00
Matthias Radestock 85971193a8 simplify check for --local 2015-04-11 17:58:26 +01:00
Matthias Radestock 59ae50eb4e don't rely on docker inspect for determining container death
Docker can take a while to notice & record the death of containers, so
we perform a more direct check instead.

Fixes #522.
2015-04-11 12:24:09 +01:00
Matthias Radestock f433d26d1f fix typo 2015-04-11 12:23:57 +01:00
rade cd81101508 Merge pull request #546 from rade/awh-handle_signals_without_tty
Implement weaveexec signal proxy

Fixes the following issues with remote (i.e. w/o `--local`) execution of the weave script via a container, as per #507:

1. stderr is merged into stdout
2. line termination with CRLF instead of LF
3. ctrl-c is ignored

Fixes #507. Closes #523.
2015-04-11 11:55:46 +01:00
Adam Harrison 338d577fb7 Implement weaveexec signal proxy 2015-04-11 11:50:42 +01:00
Matthias Radestock 39b9034fef there is no need for multiweave to use --local 2015-04-11 00:18:42 +01:00
Matthias Radestock 363814db5c simplify "need to run as root" condition 2015-04-11 00:07:23 +01:00
rade c2042d52f8 Merge pull request #545 from rade/errordeveloper-issue_540
Only check kernel version and ip command in local mode

Fixes #540. Closes #542.
2015-04-10 23:03:03 +01:00
Ilya Dmitrichenko 35d32bd03a Only check kernel version and ip command in local mode (close #540) 2015-04-10 23:01:59 +01:00
Matthias Radestock 8fcd56bc68 Merge branch 'bboreham-543-fix-fieldvalidator'
Fixes #543.
2015-04-10 22:43:26 +01:00
Bryan Boreham d228a4450a Make sure FieldValidator methods act on the object we pass in.
Added a unit test for FieldValidator
2015-04-10 22:42:40 +01:00
Matthias Radestock d19d485d39 refactor: make LocalPeer.Router "private"
nothing outside LocalPeer should access it
2015-04-10 21:56:00 +01:00
David Wragg 7d51f8751b gofmt 2015-04-10 20:55:27 +01:00
rade 551c1d2925 Merge pull request #541 from abligh/support-unix-domain-control-socket
Support using a unix domain socket for the HTTP control interface.
2015-04-10 20:39:11 +01:00
Alex Bligh 9699b4ce1a Support using a unix domain socket for the HTTP control interface.
When running multiple weaver daemons it is convenient for the HTTP
control interface to bind to a UNIX domain socket, to avoid the
need to allocate an additional unique port. This commit adds the
ability to specify
   httpaddr="/path/to/socket"
on the command line.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
2015-04-10 20:18:27 +01:00
rade 3a83570005 Merge pull request #526 from bboreham/extend-ps
Allow container names/ids to be supplied to `weave ps`
2015-04-10 15:57:53 +01:00
Matthias Radestock f88ce6e798 don't mention defaults twice in usage
go's flag package already shows the default values, so we only need to
mention them when they are determined later.
2015-04-10 15:38:11 +01:00
Matthias Radestock 0799d9f70b shorten connection timeout for http interactions with containers
This issue came to light in the context of `weave launch`. When the
weaver container died after we've completed network configuration, it
would take a minute for the script to terminate, due to `curl` being
stuck in a connection attempt.

Fixes #538.
2015-04-10 15:33:11 +01:00
rade db302a0d3d Merge pull request #539 from abligh/make-iface-mandatory
Error if neither -iface or -name is specified
2015-04-10 15:22:07 +01:00
Alex Bligh 24bd7151e2 Error if neither -iface or -name is specified
This prevents a nil pointer dereference if (e.g.) weaver is
invoked with no arguments.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
2015-04-10 15:14:51 +01:00
Bryan Boreham 10bd84a460 Document name-list option to weave ps 2015-04-10 15:08:35 +01:00
rade 0540e41ffd Merge pull request #537 from bboreham/master
Simplify printing
2015-04-10 14:51:30 +01:00
Bryan Boreham d32f328c24 Simplify printing 2015-04-10 14:46:31 +01:00
rade c13980af4b Merge pull request #536 from dpw/535-golang142
Docker needs golang 1.4.2 to build, so we do too

Fixes #535.
2015-04-10 14:10:46 +01:00
rade bd8cb02f17 Merge pull request #534 from abligh/select-ports-on-cli
Add options to set ports on weaver command line
2015-04-10 13:54:41 +01:00
David Wragg 162b056784 Docker needs golang 1.4.2 to build, so we do too 2015-04-10 12:45:27 +01:00
Alex Bligh 12d88eac23 Add options to set ports on weaver command line
This commit adds two command line options, intended to allow multiple
instances of weave to run without container separation between them.

* -port=PORT makes weave bind to port PORT (an integer). Without the
  option, the default value (6783) is used.

* -httpaddr=ADDRESS makes weave bind its control interface to
  a different address. For instance "127.0.0.1:6784" can be used to
  bind to localhost only. An absent address element makes it bind to
  all interfaces. ":6784" is the default. An empty string
  can be used to disable the control interface.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
2015-04-10 12:09:13 +01:00
Matthias Radestock f3d20111d8 eliminate dependency on LocalPeer.Router
(from things outside LocalPeer)
2015-04-10 10:51:40 +01:00
Bryan Boreham 2ba8f34132 Merge pull request #521 from rade/517_lower_topology_periodic_gossip_complexity
LGTM.  Closes #517
2015-04-10 10:08:23 +01:00
David Wragg bb9e26b4ae Merge pull request #528 from 'bboreham/name_change' 2015-04-10 08:03:38 +01:00
rade ff657d1512 Merge pull request #533 from abligh/fix-dockerless-ip-address
Fix dockerless.txt
2015-04-09 21:45:38 +01:00
Alex Bligh 26d9c37dd2 Fix dockerless.txt
The IP address for VM1 is 192.168.122.2/24. 192.168.122.1/24 is virbr0.
2015-04-09 21:11:18 +01:00
Matthias Radestock 12c97b4fc5 topology-sensitive random selection of gossip neighbours 2015-04-09 18:10:57 +01:00
Bryan Boreham 642cc3f00e Change release GitHub user name from zettio to weaveworks 2015-04-09 17:32:36 +01:00
Bryan Boreham a4fd0b571d Row back on Docker image names until we do a release under the weaveworks name 2015-04-09 11:46:08 +01:00
Matthias Radestock f5362289cf switch to a more efficient GC for gossip senders 2015-04-09 11:44:13 +01:00
Matthias Radestock 40d127d9a4 make connection heartbeating independent of periodic gossip
This was a convenient but rather suspect coupling. In particular, it
will break if the period gossip logic changes s.t. it no longer sends
gossip on all connections every interval.
2015-04-09 11:44:13 +01:00
Bryan Boreham 067ba6d970 Fix all zettio.github.io links too 2015-04-09 11:39:55 +01:00
Bryan Boreham cec1efbcef Merge pull request #530 from rade/529_eliminate_connection_add_remove_race
Very subtle, but it looks ok to me.  Fixes #529
2015-04-09 10:36:27 +01:00
Matthias Radestock e639007b62 eliminate AddConnection/RemoveConnection race
We were invoking AddConnection in a separate goroutine, and this could
result in RemoveConnection getting invoked first, resulting in bogus
entries in our connection map, which would effectively prevent
connectivity to the other peer until the stale entry got removed
through a lost tie break. And if, per chance, the remote end ran into
exactly the same race condition, then connectivity between that peer
and ourself was broken permanently.

Hitting this race condition required a combination of a) no UDP
heartbeat being received for HeartbeatTimeout(30s) - this causes the
actorLoop to terminate and RemoveConnection to be invoked, and b) the
AddConnection invocation getting delayed for at least that long.
2015-04-09 06:34:35 +01:00
Matthias Radestock 56f5c749e1 optimise broadcast route calculation
...by obtaining our connection set just once. This also guards against
potential locking issues, since we no longer obtain the required
lock on our local peer while holding a lock on Peers.

Note that this change means the connection list can be out of date by
the time we enter Peers.ForEach. However, previously it was possible
for the list to change for each peer we are iterating over. So it's
just a different flavour of out-of-dateness.
2015-04-08 21:54:45 +01:00
Matthias Radestock ec30bdaf3d explain kernel settings that need changing 2015-04-08 18:33:39 +01:00
David Wragg 74dae2abb4 Allow multiweave to be run from any directory 2015-04-08 18:16:10 +01:00