Commit graph

2840 commits

Author SHA1 Message Date
Flavio Crisciani
3d2b2f1c7e Possible race on ingress programming
Make sure that iptables operations on ingress
are serialized.
Before 2 racing routines trying to create the ingress chain
were allowed and one was failing reporting the chain as
already existing.
The lock guarantees that this condition does not happen anymore

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-06-07 13:02:04 -07:00
Sebastiaan van Stijn
01e6a24545 Update miekg/dns to v1.0.7
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-01 16:32:04 +02:00
Flavio Crisciani
9310db12ae Merge pull request #2176 from ctelfer/remove-net-attach-info
Remove non-service cluster info on sbLeave
2018-05-31 13:31:20 -07:00
Chris Telfer
c4d507b566 Remove non-service cluster info on sbLeave
The system should remove cluster service info including networkDB
entries and DNS entries for container endpoints that are not part of a
service as well as those that are part of a service.  This used to be
the normal sequence of operations but it moved to
sandbox.DisableService() in an effort to more gracefully handle endpoint
removal from a service (which proved insufficient).  Unfortunately
subsequent changes also removed the newly-mandetory call to
sandbox.DisableService() preventing proper cleanup for non-service
container endpoints.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-05-31 14:21:55 -04:00
Yang Li
b0b5e14b77 test: update tests to use sub-benchmarks
Go 1.7 added the subtest feature which can make table-driven tests much easier to run and debug. Some tests are not using this feature.

Signed-off-by: Yang Li <idealhack@gmail.com>
2018-05-31 11:34:15 +08:00
Chris Telfer
147912afad Merge pull request #2132 from cziebuhr/2093-iface_order2
Improve interface order
2018-05-30 12:26:38 -04:00
Euan Harris
e3c212c224 types: Handle IPv6 literals correctly in port bindings
Use net.splitHostPort() instead of our own logic in func (p *PortBinding)
FromString(s string) error.   This means that IPv6 literals, including
IPv4 in IPv6 literals, can now be parsed from the string form of
PortBindings.   Zoned addresses do not work - net.splitHostPort() parses
them but net.ParseIP() cannot and returns an error.   This is ok because
we do not have a slot to store the zone name in PortBinding anyway.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-30 16:12:19 +01:00
Flavio Crisciani
185a889a82 Merge pull request #2167 from fcrisciani/fix-typo
Fix type in error message
2018-05-29 09:43:54 -07:00
Flavio Crisciani
328948d35a Fix type in error message
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-05-29 08:56:49 -07:00
Flavio Crisciani
a1c61ab794 Merge pull request #2161 from fcrisciani/networkdb-test-image
Enable network-db test image creation
2018-05-29 08:47:28 -07:00
Flavio Crisciani
87d6ce3d5a Merge pull request #2164 from idealhack/typo
typo: fix misspells in code and comments
2018-05-29 08:45:48 -07:00
Flavio Crisciani
1784a46e64 Enable network-db test image creation
Updated makefile
Moved binaries in the bin/ directory

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-05-29 08:03:32 -07:00
Chris Telfer
55567d88e4 Merge pull request #2165 from idealhack/tests
test: fix ineffectual assignments
2018-05-29 10:51:23 -04:00
Yang Li
f6d9d22e6f test: fix ineffectual assignments
Signed-off-by: Yang Li <idealhack@gmail.com>
2018-05-29 18:08:32 +08:00
Yang Li
f9f3b1bdeb typo: fix misspells in code and comments
Signed-off-by: Yang Li <idealhack@gmail.com>
2018-05-29 17:08:41 +08:00
Christoph Ziebuhr
67dbb04852 Improve interface order
Signed-off-by: Christoph Ziebuhr <chris@codefrickler.de>
2018-05-25 17:40:32 +02:00
Flavio Crisciani
350fc8fc17 Merge pull request #2163 from euanh/shell-needs-build-image
Makefile: build image is a prerequisite of the shell target
2018-05-25 07:54:43 -07:00
Euan Harris
e7fcca2f9f Makefile: build image is a prerequisite of the shell target
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-25 15:43:08 +01:00
Chris Telfer
2db504266a Merge pull request #2159 from euanh/typos
Fix trivial typos
2018-05-24 10:03:52 -04:00
Euan Harris
35f505210b types/types: Correct docstring typo for (PortBinding)FromString
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-24 14:35:36 +01:00
Euan Harris
f6ddf88cec types/types_test: Rename test to match function
The function tested by TestUtilGetHostPortionIP is called GetHostPartIP.
Rename the test to match the function being tested.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-24 10:03:25 +01:00
Euan Harris
ebf0054912 ipam/allocator: Fix typos in error message
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-23 11:03:55 +01:00
Madhu Venugopal
fa29610f7e Merge pull request #2153 from fcrisciani/maintainers
Maintainers update
2018-05-21 18:48:34 -04:00
Flavio Crisciani
5f0e69d002 Merge pull request #2152 from euanh/ipam-pool-double-alloc-test
ipam/allocator_test: Test pool double-release behavior
2018-05-21 10:30:27 -07:00
Flavio Crisciani
3f2d3d175f Merge pull request #2151 from euanh/make-shell
Makefile: Add shell target
2018-05-21 10:23:38 -07:00
Flavio Crisciani
48eba3c2c9 Maintainers update
- Add Abhi and Chris
- Remove inactive maintainers

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-05-18 09:36:32 -07:00
Euan Harris
35a81f8173 ipam/allocator_test: Test pool double-release behavior
Releasing a pool which has already been released should fail; this
change increases coverage by a fraction by exercising this path.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-18 17:32:36 +01:00
Euan Harris
b4c09ceae2 Makefile: Add shell target
This makes it easy to drop into the build container, for instance to
run tests or other Go tools over a subset of the code.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-18 16:44:00 +01:00
Flavio Crisciani
6130c11481 Merge pull request #2147 from abhi/logs
Adding logs for ipam state
2018-05-14 19:35:10 -07:00
Abhinandan Prativadi
2f2811dd14 Adding logs for ipam state
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2018-05-14 15:44:49 -07:00
Abhinandan Prativadi
dfa303e568 fixing test cases
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2018-05-10 14:47:52 -07:00
Abhinandan Prativadi
9fe5cc10b2 Add check for overlapping subnets
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2018-05-10 14:47:07 -07:00
Flavio Crisciani
60d8639a81 Merge pull request #2144 from u2takey/master
fix markdown style in doc
2018-05-04 22:30:06 -07:00
Flavio Crisciani
c972ab8fe7 Merge pull request #2143 from ctelfer/overlay-race-fix
Fix race conditions in the overlay network driver
2018-05-03 11:17:51 -07:00
u2takey
5eb96dfbba fix markdown style in doc
Signed-off-by: u2takey <u2takey@gmail.com>
2018-05-02 17:46:24 +08:00
Chris Telfer
c97bb41620 Remove race in encrypted overlay key update
Multiple simultaneous updates here would leave the driver in a very
inconsistent state.  The disadvantage to this change is that it requires
holding the driver lock while reprogramming the keys.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-05-01 17:41:47 -04:00
Chris Telfer
40b55d2336 Remove race condition from ovnmanager
This one is probably not critical.  The worst that seems like could
happen would be if 2 deletes occur at the same time (one of which
should be an error):
  1. network gets read from the map by delete-1
  2. network gets read from the map by delete-2
  3. delete-1 releases the network VNI
  4. network create arrives at the driver and allocates the now free VNI
  5. delete-2 releases the network VNI (error: it's been reallocated!)
  6. both networks remove the VNI from the map

Part 6 could also become an issue if there were a simultaneous create
for the network at the same time.  This leads to the modification of
the NewNetwork() method which now checks for an existing network before
adding it to the map.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-05-01 17:41:42 -04:00
Chris Telfer
b64997ea82 Fix race conditions in overlay network driver
The overlay network driver is not properly using it's mutexes or
sync.Onces.  It made the classic mistake of not holding a lock through
various read-modify-write operations.  This can result in inconsistent
state storage leading to more catastrophic issues.

This patch attempts to maintain the previous semantics while holding the
driver lock through operations that are read-modify-write of the
driver's network state.

One example of this race would be if two goroutines tried to invoke
d.network() after the network ID was removed from the table.  Both would
try to reinstall it causing the "once" to get reinitialized twice
without any lock protection.  This could then lead to the "once" getting
invoked twice on the same network.  Furthermore, the changes to one of
these network structures gets effectively discarded.  It's also the
case, that because there would be two simultaneous instances of the
network, the various network Lock() invocations would be meaningless for
race prevention.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-05-01 17:17:27 -04:00
Flavio Crisciani
5c679b051d Merge pull request #2142 from ctelfer/xfilter-warn-timestamp
Add wait time into xtables lock warning
2018-04-26 13:16:50 -07:00
Chris Telfer
3df00a6c64 Add wait time into xtables lock warning
Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-04-26 14:21:36 -04:00
Flavio Crisciani
8a554b8cee Merge pull request #2141 from fcrisciani/requestpool-test
Add test for parallel request pool
2018-04-25 16:34:58 -07:00
Flavio Crisciani
606e28015a Add test for parallel request pool
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-04-25 16:09:27 -07:00
Flavio Crisciani
0513f1f098 Merge pull request #2135 from ctelfer/xtables-filter
filter xtables lock warnings when firewalld is active
2018-04-25 15:19:41 -07:00
Chris Telfer
16e077b884 Filter xtable wait messages when using firewalld
This gets filtered for raw iptables calls, but not from calls made
through firewalld.   The patch just ensures consistency of operation.
It also adds a warning when xtables contention detected and truncates
the search string slightly as it appears that the suffix will be
changing in the near future.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-04-25 16:26:08 -04:00
Flavio Crisciani
aa0aad381f Merge pull request #2140 from kolyshkin/context
Switch from x/net/context to context
2018-04-24 15:41:35 -07:00
Kir Kolyshkin
0f6cb61f2d Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since about Go 1.9 time,
all x/net/context provides is a few aliases to types in context, meaning
"x/net/context" and "context" can be mixed freely.

Some vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-24 14:57:04 -07:00
Kir Kolyshkin
a6ec9e673b Bump golang.org/x/net
This version includes "x/net/context" which is fully compatible with
the standard Go "context" package, so the two can be mixed together.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-24 14:40:29 -07:00
Flavio Crisciani
65e8971ffd Merge pull request #2134 from dani-docker/esc-532
Adding a recovery mechanism for a split gossip cluster
2018-04-23 13:14:27 -07:00
Dani Louca
96472cdaea Adding a recovery mechanism for a split gossip cluster
Signed-off-by: Dani Louca <dani.louca@docker.com>
2018-04-23 14:18:46 -04:00
Madhu Venugopal
9c2e855b71 Merge pull request #2136 from cpuguy83/fix_map_access_panic_ndb
networkdb: Use write lock in handleNodeEvent
2018-04-11 20:31:03 -07:00