1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

1893 commits

Author SHA1 Message Date
Flavio Crisciani
1bb664f689 Merge pull request from abhi/ipam_alloc
Serializing bitseq alloc
2017-10-03 13:30:34 -07:00
Abhinandan Prativadi
3d44975995 Adding a unit case to verify rollover
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-10-03 12:15:34 -07:00
Flavio Crisciani
ad577a25fe Changed ipMask to string
Avoid error logs in case of local peer case, there is no need for deleteNeighbor
Avoid the network leave to readvertise already deleted entries to upper layer

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 17:29:18 -07:00
Flavio Crisciani
181115b350 Addressing code review comments
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:36 -07:00
Flavio Crisciani
2bad0fbedf log for miss notification
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:36 -07:00
Flavio Crisciani
3e7b6c9cb0 flush peerdb entries on network delete
peerDB was never being flushed on network delete
leaveing behind stale entries

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:35 -07:00
Flavio Crisciani
711d033757 Handle IP reuse in overlay
In case of IP reuse locally there was a race condition
that was leaving the overlay namespace with wrong configuration
causing connectivity issues.
This commit introduces the use of setMatrix to handle the transient
state and make sure that the proper configuration is maintained

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:33 -07:00
Flavio Crisciani
ef2e91707d Merge pull request from ityangchen/test-libnetwork
Repair (*Broadcaster).run goroutine leak
2017-09-30 10:44:12 -07:00
Flavio Crisciani
b92d91d6a1 Fix comparison against wrong constant
The comparison was against the wrong constant value.
As described in the comment the check is there to guarantee
to not propagate events realted to stale deleted elements

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-29 21:05:24 -07:00
Abhinandan Prativadi
813a24a51c Minor unit test change
Since bit allocation is no longer first available from
the start some verfications are removed/modified to
the change allocation model

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-09-29 11:33:26 -07:00
Abhinandan Prativadi
a52bcf48f2 Serializing bitseq alloc
Previously the bitseq alloc was allocating the first available bit from the
begining of the sequence. With this commit the bitseq alloc will proceed
from the current allocation. This change will affect the way ipam and vni
allocation is done currently. The ip allocation will be done sequentially
from the previous allocation as opposed to the first available IP.

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-09-29 11:33:26 -07:00
yangchenliang
955c532735 Repair (*Broadcaster).run goroutine leak
When execute 'docker swarm init' and 'docker swarm leave -f' on a node
repeatedly, the (*Broadcaster).run goroutine leak.

Signed-off-by: yangchenliang <yangchenliang@huawei.com>
2017-09-29 18:56:16 +08:00
Flavio Crisciani
8c31217a44 NetworkDB create NodeID for cluster nodes
Separate the hostname from the node identifier. All the messages
that are exchanged on the network are containing a nodeName field
that today was hostname-uniqueid. Now being encoded as strings in
the protobuf without any length restriction they plays a role
on the effieciency of protocol itself. If the hostname is very long
the overhead will increase and will degradate the performance of
the database itself that each single cycle by default allows 1400
bytes payload

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-26 10:48:04 -07:00
Flavio Crisciani
a4e64d05c1 Avoid alignment of reapNetwork and tableEntries
Make sure that the network is garbage collected after
the entries. Entries to be deleted requires that the network
is present.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-22 10:57:47 -07:00
Flavio Crisciani
053a534ab1 Changed ReapTable logic
- Changed the loop per network. Previous implementation was taking a
  ReadLock to update the reapTime but now with the residualReapTime
  also the bulkSync is using the same ReadLock creating possible
  issues in concurrent read and update of the value.
  The new logic fetches the list of networks and proceed to the
  cleanup network by network locking the database and releasing it
  after each network. This should ensure a fair locking avoiding
  to keep the database blocked for too much time.

  Note: The ticker does not guarantee that the reap logic runs
  precisely every reapTimePeriod, actually documentation says that
  if the routine is too long will skip ticks. In case of slowdown
  of the process itself it is possible that the lifetime of the
  deleted entries increases, it still should not be a huge problem
  because now the residual reaptime is propagated among all the nodes
  a slower node will let the deleted entry being repropagate multiple
  times but the state will still remain consistent.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-21 09:37:47 -07:00
Flavio Crisciani
2d2a2bc568 Fix reapTime logic in NetworkDB
- Added remainingReapTime field in the table event.
  Wihtout it a node that did not have a state for the element
  was marking the element for deletion setting the max reapTime.
  This was creating the possibility to keep the entry being resync
  between nodes forever avoding the purpose of the reap time
  itself.

- On broadcast of the table event the node owner was rewritten
  with the local node name, this was not correct because the owner
  should continue to remain the original one of the message

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-21 09:37:37 -07:00
Flavio Crisciani
729d45379f Fix lint issues
The package updated and now shows new warnings that had to be corrected
to let the CI pass

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-20 08:57:02 -07:00
Flavio Crisciani
ad54472474 Merge pull request from thaJeztah/fix-faulty-test
Fix test using com.docker.network.mtu
2017-09-13 09:31:36 -07:00
Flavio Crisciani
fa61cbb30e Merge pull request from pradipd/windows_routingmesh
Enabling ILB/ELB on windows using per-node, per-network LB endpoint.
2017-09-12 09:56:48 -07:00
Flavio Crisciani
5e03465a27 Merge pull request from fcrisciani/limit-mtu
Add a minimum value for the CP MTU
2017-09-11 08:34:26 -07:00
Pradip Dhara
a3c3a596dd PR feedback
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-09-07 10:36:11 -07:00
Pradip Dhara
495252723d Fixing a race condition that caused a Panic when deleting overlay network then quickly leaving swarm.
This issue was uncovered in TestOverlayAttachableReleaseResourcesOnFailure.

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-09-05 14:33:27 -07:00
m1093782566
89aeeb294c support flush services API
Signed-off-by: m1093782566 <dujun5@huawei.com>
2017-09-03 16:04:16 +08:00
Pradip Dhara
cc08cacfab Vendoring microsoft/hcsshim v0.6.3
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-29 22:44:33 -07:00
Flavio Crisciani
b76166c110 Increase code coverage for set_matrix
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-29 21:21:47 -07:00
Pradip Dhara
43360c627f Enabling ILB/ELB on windows using per-node, per-network LB endpoint.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-29 00:17:42 -07:00
Flavio Crisciani
0482b29df1 Enable codeconv reporting
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-28 12:00:28 -07:00
Flavio Crisciani
a0bdc52fd7 Merge pull request from pradipd/overlay_one_endpoint
Tasks connected to a swarm network will have 1 endpoint on windows RS3.
2017-08-28 09:22:28 -07:00
Flavio Crisciani
c46821d1eb Merge pull request from fcrisciani/logfix
fix log
2017-08-24 15:41:26 -07:00
Flavio Crisciani
bd225f1d6d Merge pull request from tomoyat1/freebsd-portallocator
Add support for FreeBSD in portallocator
2017-08-24 15:40:53 -07:00
Flavio Crisciani
0fc6ce881f fix log
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-24 15:09:24 -07:00
Flavio Crisciani
38382fb29b Merge pull request from aaronlehmann/sprintfs
all: Avoid trivial uses of Sprintf
2017-08-23 15:49:46 -07:00
Flavio Crisciani
e0252061d0 Merge pull request from huikang/remove-unused-go-packages-ci
Remove unused packages in circle.yml
2017-08-23 15:32:02 -07:00
Flavio Crisciani
2fc6b96a3c Merge pull request from huikang/dnet-remove-unused-method
dnet: remove unused method for dnetConnection struct
2017-08-23 15:27:35 -07:00
Yuanhong Peng
10c88fc3ab Ignore "no such file" error when docker cannot find resolv.conf
`/etc/resolv.conf` is not an essential file in filesystem. (see
http://man7.org/linux/man-pages/man5/resolv.conf.5.html)

> If this file does not exist, only the name server on the local machine
> will be queried

It's baffling to users that containers can start with an empty
`resolv.conf` but cannot without this file.

This PR:
* ignore this error and use default servers for containers in `bridge`
  mode networking.
* create an empty resolv.conf in `/var/lib/docker/containers/<id>` in
  `host` mode networking.

Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>
2017-08-22 10:20:44 +08:00
Brian Goff
663672b8c7 Lock goroutine to OS thread while changing NS
Prevents an issue where the goroutine may jump to a new OS thread during
execution putting it into a mount/network NS that is unexpected.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 6d8617d8757a759d806a3307ca04d4d588c04aed)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-08-16 12:14:56 -04:00
Flavio Crisciani
a6073649e9 Add a minimum value for the CP MTU
Avoid negative numbers and also set a lower bondary.
500 will mean 400 bytes minimum payload that will allow
at least a couple of gossip message to fit.
There is not theoretical limit becasue the message is made of
strings so there is still the possibility to have cases where
the 400 bytes are not enough to fit a single message, but
in that case we should start thinking why do I need a node
name that is long as an enciclopedia

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-14 09:26:41 -07:00
Flavio Crisciani
a15113e012 Remove useless flags on operations
In the peerDelete the updateDB flag was always true
In the peerAdd the updateDB flag was always true except for
the initSandbox case. But now the initSandbox is handled by the
go routing of the peer operations, so we can move that flag
down and remove it from the top level functions

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-14 09:20:55 -07:00
Sebastiaan van Stijn
998a93783e Fix test using com.docker.network.mtu
This should be `com.docker.network.driver.mtu`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-14 16:22:11 +02:00
Madhu Venugopal
5de16c2168 Merge pull request from fcrisciani/fix-peerdelete
PeerDbDelete was passing the wrong field
2017-08-11 16:47:58 -07:00
Flavio Crisciani
b7c258cf07 PeerDbDelete was passing the wrong field
The peerDbDelete was passing the wrong field to the underlay
Delete operation causing the mac entry to not being deleted
from the bridge on the overlay. This caused connectivity issue
when a container that before was remote was now scheduled
on the local node. The entry was such:
bridge fdb show | grep -i 02:42:0a:01:00:02
02:42:0a:01:00:02 dev vxlan0 master br0
02:42:0a:01:00:02 dev vxlan0 dst 172.31.14.63 link-netnsid 0 self permanent
That was still pointing to a remove node

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-11 16:19:59 -07:00
Pradip Dhara
0651183f84 gofmt and lint changes.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-09 15:53:27 -07:00
Pradip Dhara
404a9ffa5a For RS3, tasks connected to a swarm network will have 1 endpoint .
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-09 14:13:59 -07:00
Flavio Crisciani
3c1ebfaef9 Add service virtual IP to sandbox's loopback address
Refreshed the PR: https://github.com/docker/libnetwork/pull/1585
Addressed comments suggesting to remove the IPAlias logic not anymore used

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-08 16:16:45 -07:00
Madhu Venugopal
1662fc9709 Merge pull request from dmcgowan/update-logrus
Update logrus to v1.0.1
2017-08-08 14:01:10 -07:00
Derek McGowan
710e0664c4 Update logrus to v1.0.1
Fix case sensitivity issue
Update docker and runc vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-07 11:20:47 -07:00
Santhosh Manohar
88043e6188 Merge pull request from thaJeztah/more-resolver-logging
Improve debugging for resolver
2017-08-06 17:31:30 -07:00
Flavio Crisciani
2e38c53def PeerInit for the sandbox init
Move the sandbox init logic into the go routine that handles
peer operations.
This is to avoid deadlocks in the use of the pMap.Lock for the
network

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-05 12:07:31 -07:00
Flavio Crisciani
5c52ff49e0 Funnel peerAdd and peerDelete in a channel
Remove the need for the wait group and avoid new
locks
Added utility to print the method name and the caller name

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-05 12:07:31 -07:00
Flavio Crisciani
b8d514432d Revert "Avoid peerUpdate logic in swarm mode"
This reverts commit b65a4ee10e.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-05 12:07:16 -07:00