Commit graph

2266 commits

Author SHA1 Message Date
Flavio Crisciani
f969f26966 Service discovery race on serviceBindings delete. Bug on IP reuse (#1808)
* Correct SetMatrix documentation

The SetMatrix is a generic data structure, so the description
should not be tight to any specific use

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* Service Discovery reuse name and serviceBindings deletion

- Added logic to handle name reuse from different services
- Moved the deletion from the serviceBindings map at the end
  of the rmServiceBindings body to avoid race with new services

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* Avoid race on network cleanup

Use the locker to avoid the race between the network
deletion and new endpoints being created

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* CleanupServiceBindings to clean the SD records

Allow the cleanupServicebindings to take care of the service discovery
cleanup. Also avoid to trigger the cleanup for each endpoint from an SD
point of view
LB and SD will be separated in the future

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* Addressed comments

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* NetworkDB deleteEntry has to happen

If there is an error locally guarantee that the delete entry
on network DB is still honored

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-18 05:25:58 -07:00
Santhosh Manohar
0dd3fd69a1 Merge pull request #1815 from mavenugo/fl
Flavio as Libnetwork maintainer
2017-06-16 21:09:34 -07:00
Madhu Venugopal
c48c1a3748 Flavio as Libnetwork maintainer
Flavio has been contributing various useful features in Docker 17.05
and 17.06 releases and also an active maintainer who helps with various
bug fixes and PR reviews

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-06-16 19:38:27 -07:00
Santhosh Manohar
eca6a26e0b Merge pull request #1807 from msabansal/transparentfix
Fixes docker daemon not starting after endpoint leak
2017-06-16 11:42:08 -07:00
Sandeep Bansal
2d278dece0 Fixes docker daemon not restarting after endpoint leak on windows with transaprent network
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-06-15 13:27:48 -07:00
Madhu Venugopal
ca1d612988 Merge pull request #1806 from fcrisciani/logfix
Fix handleEPTable log
2017-06-13 20:06:50 -07:00
Madhu Venugopal
9f6f2c27f8 Merge pull request #1778 from WeiZhang555/fix-leaking-netns-file
[bug]Fix race between sandbox.delete() and SetKey()
2017-06-13 20:06:09 -07:00
Flavio Crisciani
ba788519d6 Fix handleEPTable log
There was an extra parameter not in the formatters

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-13 15:47:31 -07:00
Madhu Venugopal
0585b10fd3 Merge pull request #1776 from fcrisciani/makefile
Makefile
2017-06-12 11:56:34 -07:00
Flavio Crisciani
65860255c6 Fixed code issues
Fixed issues highlighted by the new checks

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:35 -07:00
Flavio Crisciani
a018694f40 Added more code checks
Added missspelling
Added fmt, vet, lint, ineffassign

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:33 -07:00
Flavio Crisciani
d69db01eb8 Bump docker base image to 1.8.3
added also new dependencies used in the new makefile

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:32 -07:00
Madhu Venugopal
a5747af4c2 Merge pull request #1803 from fcrisciani/ipvs-hardening
IPVS fix
2017-06-12 00:32:27 -07:00
Flavio Crisciani
c0f59f9643 IPVS fix
In accordance with the logic for SD, remove the ipvs rules
only when there is no more endpoints using the IP

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 00:07:39 -07:00
Madhu Venugopal
79bb7f8674 Merge pull request #1796 from fcrisciani/name-resolution-race
Service discovery hardening
2017-06-11 22:22:53 -07:00
Flavio Crisciani
39d2204896 Service discovery logic rework
changed the ipMap to SetMatrix to allow transient states
Compacted the addSvc and deleteSvc into a one single method
Updated the datastructure for backends to allow storing all the information needed
to cleanup properly during the cleanupServiceBindings
Removed the enable/disable Service logic that was racing with sbLeave/sbJoin logic
Add some debug logs to track further race conditions

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-11 20:49:29 -07:00
Flavio Crisciani
2111d4cafb Create SetMatrix data structure
SetMatrix is a simple matrix of sets.
Added tests

This data structure will be used in following commit to handle
transient states where the same key can momentarely be associated
to more than a value

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-08 13:33:49 -07:00
Madhu Venugopal
fad71827be Merge pull request #1795 from fcrisciani/sysctl_gc_thresh
Fix OS tweaks call
2017-06-06 21:09:05 -07:00
Flavio Crisciani
233aa636d7 Fix OS tweaks call
The feature was not getting properly triggered, move it as
first operation in the configure

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 20:30:41 -07:00
Madhu Venugopal
23a2381954 Merge pull request #1786 from fcrisciani/netlink_leak
Fix leak of watchMiss goroutine
2017-06-06 13:31:16 -07:00
Madhu Venugopal
78a910ee17 Merge pull request #1787 from fcrisciani/goroutine_leak
Fix leak of handleTableEvents
2017-06-06 13:17:17 -07:00
Flavio Crisciani
acf9c53292 Vendoring netlink library
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 09:24:22 -07:00
Flavio Crisciani
d5c69190d1 Fix leak of watchMiss goroutine
The netlink socket that was used to monitor the L2
miss was never being closed. The watchMiss goroutine
spawned was never returning. This was causing goroutine
leak in case of createNetwork/destroyNetwork

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 09:24:21 -07:00
Madhu Venugopal
d65565610f Merge pull request #1781 from fcrisciani/vxlan-issue
Removed printfs
2017-06-05 19:24:41 -07:00
Madhu Venugopal
54d627c69d Merge pull request #1792 from sanimej/mac2
Remove dynamic mac entry from fdb on endpoint deletion
2017-06-05 16:30:08 -07:00
Santhosh Manohar
22814d5850 Merge pull request #1789 from fcrisciani/sysctl_gc_thresh
Set kernel specific config on linux
2017-06-02 21:56:07 -07:00
Flavio Crisciani
4abd54d419 Set kernel specific config on linux
On linux systems bump up gc_thresholds so to lower the
probability of running with neighbor table overflow issues

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-02 21:00:56 -07:00
Santhosh Manohar
e49955988a Remove dynamic mac entry from fdb on endpoint deletion
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-06-01 12:20:46 -07:00
Madhu Venugopal
59994bbb15 Merge pull request #1775 from sanimej/gossip
Handle single manager reload by having workers reconnect
2017-05-31 14:57:34 -07:00
Santhosh Manohar
ca9a768d80 Handle single manager reload by having workers reconnect
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-05-31 14:36:23 -07:00
Flavio Crisciani
6d768ef73c Fix leak of handleTableEvents
The channel ch.C is never closed.
Added the listen of the ch.Done() to guarantee
that the goroutine is exiting once the event channel
is closed

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-31 11:04:19 -07:00
Madhu Venugopal
7d9c6e89f8 Merge pull request #1785 from abhinandanpb/master
Removing the override for ipamdriver for local scope networks in
2017-05-30 21:27:39 -07:00
Abhinandan Prativadi
26fb58d3a8 Removing the override for ipamdriver for local scope networks
The commit contains fix for the issue reported in
https://github.com/moby/moby/issues/33415 and
https://github.com/docker/libnetwork/issues/1772. With the
feature introduced to support local scope networks in swarm
mode the network configuration to include ipam driver was overriden
in libnetwork. This has been removed with this fix which will allow
ipam-driver option to be used for task allocation

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-05-30 16:01:15 -07:00
Madhu Venugopal
430367de2d Merge pull request #1779 from fcrisciani/revert-1777-move_provider
Revert "Move Cluster provider back to Moby"
2017-05-28 14:01:11 -07:00
Flavio Crisciani
ae9f1f9f04 Removed printfs
Changed some prints into proper logging, also
was missing the \n at the end

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-26 14:13:26 -07:00
Flavio Crisciani
34ce7c7e6a Revert "Move Cluster provider back to Moby"
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-25 10:47:02 -07:00
Madhu Venugopal
66c0b8b88b Merge pull request #1777 from fcrisciani/move_provider
Move Cluster provider back to Moby
2017-05-25 08:58:02 -07:00
Madhu Venugopal
47e9baa438 Merge pull request #1770 from dhilipkumars/ipvs-getServices-dev
[IPVS] Implement GetServices(),GetService() and GetDestinations()
2017-05-25 08:45:19 -07:00
Zhang Wei
0f17689abf [Bug]Fix race between sandbox.delete() and SetKey()
When sandbox is deleting, another SetKey routine could be also in
progress as there's no lock to protect it, when this happens, there
could be a scene that one sandbox is removed, but it's osSbox file
"/var/run/docker/netns/xxxx" left on system and will never be cleaned.

So add a inDelete check for SetKey() to eliminate the race.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-05-25 15:35:24 +08:00
dhilipkumars
79a76217db fix review comments
Signed-off-by: dhilipkumars <dhilip.kumar.s@huawei.com>
2017-05-25 10:40:42 +05:30
Flavio Crisciani
e777305c7f Moby vendoring
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-24 11:46:36 -07:00
Flavio Crisciani
627da8bf04 Moved the cluster provider to Moby
Moved the cluster provider interface definition from
libnetwork to moby

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-24 11:28:23 -07:00
dhilipkumars
9376cd3c63 Fix typos and review comments
Signed-off-by: dhilipkumars <dhilip.kumar.s@huawei.com>
2017-05-24 07:56:59 +05:30
dhilipkumars
81296dda15 Update GetService(*Service) api. Update UT with new apis and remove dependency from ipvsadm
Signed-off-by: dhilipkumars <dhilip.kumar.s@huawei.com>
2017-05-23 18:47:16 +05:30
Santhosh Manohar
eb0c1ea00c Merge pull request #1774 from fcrisciani/node-leave
Node failure timeout fix
2017-05-22 18:47:14 -07:00
Flavio Crisciani
f585f33042 Node failure timeout fix
The time to keep a node failed into the failed node list
was originally supposed to be 24h.

If a node leaves explicitly it will be removed from the list of nodes
and put into the leftNodes list. This way the NotifyLeave event won't
insert it into the retry list.
NOTE: if the event is lost instead the behavior will be the same as a failed node.

If a node fails, the NotifyLeave will insert it into the failedNodes
list with a reapTime of 24h. This means that the node will be checked
for 24h before being completely forgot. The current check time is every
1 second and is done by the reconnectNode function.
The failed node list is updated every 2h instead.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-22 17:19:31 -07:00
dhilipkumars
000775b918 Initial Checkin GetServices and GetDestinations
Signed-off-by: dhilipkumars <dhilip.kumar.s@huawei.com>
2017-05-20 01:59:44 +05:30
Madhu Venugopal
1738f963ab Merge pull request #1766 from aboch/spl
Simplify network scope setting logic
2017-05-18 15:20:08 -07:00
Alessandro Boch
c7d77e9e89 Simplify network scope setting logic
- in driver(), no need to check for isAgent

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-18 15:16:48 -07:00
Madhu Venugopal
57c6fab2cc Merge pull request #1764 from aboch/isadyn
Restore isAgent || n.dynamic check
2017-05-18 13:12:29 -07:00