Commit Graph

435 Commits

Author SHA1 Message Date
Asim Aslam
9a5b8ff50d use api 2020-04-14 22:14:55 +01:00
268651df18
regenerate all proto based files (#1531)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-14 16:25:09 +03:00
9e6db79860
regenerate all proto (#1440)
* regenerate all proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* regenerate from proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* regenerate from proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-30 21:58:32 +01:00
7b385bf163
minimize allocations in logger and tunnel code (#1323)
* logs alloc

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* tunnel allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* try to fix tunnel

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* cache cipher for send

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-11 17:55:39 +00:00
117f56ebf7
prune util/log and user logger (#1237)
* prune util/log and user logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* plaintext logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* add newline

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-02-23 13:45:20 +00:00
tpam28
449bcb46fe
New backoff (#1153)
* new backoff function

* use backoff from util/backoff

* remove reset atemts

* change comment

* fmt
2020-02-02 20:32:55 +00:00
f23638c036 fix import paths for v2 release
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-01-30 14:44:40 +03:00
Asim Aslam
ae08e9c106 check if event is nil 2020-01-23 12:41:22 +00:00
Asim Aslam
9f7d374691 avoid connecting to self 2020-01-21 12:36:05 +00:00
Asim Aslam
105596a0e5 use mucp server 2020-01-18 20:48:08 +00:00
Milos Gajdos
891af703be
Update route metric when receiving Sync routes 2020-01-17 18:24:36 +00:00
Milos Gajdos
bf9f319cdf
Update route metric before sending the Sync message 2020-01-17 15:38:28 +00:00
Milos Gajdos
624f1c1980
Continue processing Sync if no routes were returned from router Query 2020-01-17 12:58:13 +00:00
Milos Gajdos
607a226e34
Updated debug logs to make them less verbose 2020-01-17 12:14:56 +00:00
Milos Gajdos
7f9b3b5556
Remove Solicitation from the network
Instead, when a new peer is discovered it is sent a sync message i.e. we
do the full sync when discovering peers
2020-01-16 19:43:10 +00:00
Milos Gajdos
8fcfbc0d20
Strip unnecessary continue statement 2020-01-16 17:33:53 +00:00
Milos Gajdos
472186c1be
Code consistency. Small bug fix. 2020-01-16 17:04:04 +00:00
Milos Gajdos
60c05bd899
Find the best routes in the routes we would advertise based on Strategy 2020-01-16 16:53:39 +00:00
Milos Gajdos
793e6013e5
Advertise routes with configured strategy. Simplify Sync apply logic 2020-01-16 16:42:23 +00:00
Milos Gajdos
eda8b00f84
Send only best routes via Sync. Only apply best routes. 2020-01-16 16:08:49 +00:00
Asim Aslam
689ae7cfc7 Storing tunnel.Session rather than transport.Client 2020-01-16 00:28:58 +00:00
Asim Aslam
19dbd77402 fix net masking in listed routes 2020-01-16 00:12:38 +00:00
Asim Aslam
33a9b3bc17 mask the route before sending 2020-01-15 23:06:58 +00:00
Asim Aslam
6562154573 Fix the next panic 2020-01-15 21:38:37 +00:00
Asim Aslam
b3e3dac975 Merge branch 'master' of ssh://github.com/micro/go-micro 2020-01-15 21:02:58 +00:00
Asim Aslam
f20e4daa60 fix rand panic 2020-01-15 21:02:53 +00:00
Milos Gajdos
36928b716c
Fixed bug:m network.proto backwards compatibility unmarshal 2020-01-15 19:45:43 +00:00
Asim Aslam
7c7b0ced5f
Merge pull request #1104 from milosgajdos83/network-hackery
[WIP] Network hackery
2020-01-14 20:28:32 +00:00
Milos Gajdos
c67ef7e017
Bug fix: skip sending sync message if the peer is not in our graph 2020-01-14 19:37:50 +00:00
Milos Gajdos
dcd925f1e5
Code cleanup; Indentation. 2020-01-14 18:48:42 +00:00
Milos Gajdos
0ea56a5ffe
Fixed tests 2020-01-14 18:22:58 +00:00
Milos Gajdos
821fda41ae
Added Status method to network.Node fixed random segfaults. 2020-01-14 18:12:36 +00:00
Asim Aslam
b699d969e4
if the address is produced by a default route don't hash it (#1108) 2020-01-14 11:20:13 +00:00
Milos Gajdos
994d371ff1
Removed redundant comments. Add proper PruneStalePeers test. 2020-01-14 10:49:34 +00:00
Milos Gajdos
a91dad04ee
Increment node error count and prune when Max limit is hit 2020-01-13 22:22:12 +00:00
Milos Gajdos
b4261e8cf9
Updated log and comments 2020-01-13 20:14:30 +00:00
Milos Gajdos
770c7686ba
Fix nasty bug when graph action may not have been executed in some
branches
2020-01-13 20:14:30 +00:00
Milos Gajdos
11904e1137
Regular sync with network every 5 minutes. Apply routes before peering. 2020-01-13 20:14:29 +00:00
Milos Gajdos
1e009e52dd
Avoid having the same log statements in initNodes and resolveNodes 2020-01-13 20:14:29 +00:00
Milos Gajdos
bf42c028fb
Added sync message. Refactored connect flow. Adverts are gossipped.
This commit adds a Sync message which is sent as a reply to Connect
message. This should in theory speed up convergence of a (re)connecting
node.

We respond to Sync message by sending a peer message back to the peer
origin of the Sync message. We consequently update our routing table and
peer graph with the data sent in via Sync message.

We now gossip advertse to up to 3 randomly selected peers instead of
sending a multicast message to the network.

Equally, Solicitation i.e. full table adverts are gossipped to a
randomly selected peer. If that fails we send a multicast message to the
network.
2020-01-13 20:14:29 +00:00
Milos Gajdos
0a4bd02503
Add RefreshSync method for Sync bookkeeping 2020-01-13 20:14:29 +00:00
Milos Gajdos
63edfaa852
Added Sync message
Sync message will be sent between peers when a new node connects/joins
the network
2020-01-13 20:14:29 +00:00
Milos Gajdos
802cc8239a
Send solicit message properly. Updated comments. 2020-01-13 20:14:29 +00:00
Milos Gajdos
59fccb82ec Updated comments. Tiny cleanup changes. (#1093) 2020-01-08 13:18:11 +00:00
Asim Aslam
b0b6b8fce2 final updates 2019-12-13 15:27:47 +00:00
Asim Aslam
f6b4a9da1c strip some code 2019-12-12 23:20:31 +00:00
Asim Aslam
74c5102e41 strip a couple things 2019-12-12 21:49:39 +00:00
Asim Aslam
7bd50cd251 fix more broken cruft 2019-12-12 17:10:32 +00:00
Asim Aslam
df728aaddd remove go routines from tunnel, fire network messages in go routines 2019-12-12 13:34:08 +00:00
Asim Aslam
e260cc4a24 save cruft 2019-12-12 12:27:46 +00:00
Asim Aslam
6e28e7a86f Save current state of the world 2019-12-11 14:37:03 +00:00
Asim Aslam
e966944ae5 sort resolved node list in network by lowest priority 2019-12-10 17:57:04 +00:00
Asim Aslam
d50f30d743 strip handlers 2019-12-10 11:46:13 +00:00
Asim Aslam
f8533551a4 move debug to trace for network peer refresh 2019-12-10 09:09:24 +00:00
Asim Aslam
7e46ff5d92 strip some more logging down 2019-12-10 09:08:03 +00:00
Asim Aslam
b29da80539 Move a few things around 2019-12-09 22:56:26 +00:00
Astone
55a15ecf12 fix tiny error in linting fixes 2019-12-09 11:18:45 +08:00
Asim Aslam
6064e1426c fix some potential go routine leaks 2019-12-08 15:02:54 +00:00
Asim Aslam
d28a868e46 Fix network startup connect 2019-12-08 14:37:17 +00:00
Asim Aslam
ce578800d0 n.initNodes 2019-12-08 12:17:31 +00:00
Asim Aslam
6307d6ba51 further cleanup of tunnel/network 2019-12-08 12:12:20 +00:00
Asim Aslam
283c85d256 done 2019-12-08 00:53:55 +00:00
Asim Aslam
9bd0fb9125 save changes 2019-12-07 23:28:39 +00:00
Asim Aslam
c445aed6b1 Cleanup and speedup network convergence along with direct messaging for connect and solicit 2019-12-07 19:54:29 +00:00
Asim Aslam
1d8c66780e save working solution 2019-12-06 00:18:40 +00:00
Asim Aslam
b0626089f3
Merge pull request #1016 from unistack-org/lint
lint fixes mostly for prealloc also remove deadcode from grpc client
2019-12-05 08:33:52 +00:00
a1eaf9cc20 linting fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2019-12-04 00:22:02 +03:00
Asim Aslam
3f8af8c1e0 Merge branch 'master' of ssh://github.com/micro/go-micro 2019-12-03 20:32:10 +00:00
Asim Aslam
becaeefcba Revert. DO NOT peer solicit until we know better 2019-12-03 20:32:02 +00:00
Asim Aslam
bb1a1358b7
Merge pull request #1012 from Astone-Chou/lint
improve code quality
2019-12-03 13:10:04 +00:00
Astone
29fb58db39 improve code quality 2019-12-03 20:59:02 +08:00
Asim Aslam
2c0801fc1c couple bug fixes in tunnel 2019-12-03 08:11:36 +00:00
Asim Aslam
5f04fd58ab optimizations to connect fast 2019-12-02 18:48:19 +00:00
Asim Aslam
c840cee404 A variety of fixes to try combat the multicast issue 2019-12-01 19:36:16 +00:00
Asim Aslam
8b63df7a98 regenerate the protos 2019-11-26 13:53:33 +00:00
Asim Aslam
080363e8c4
The mega cruft proxy PR (#974)
* the mega cruft proxy PR

* Rename broker id

* add protocol=grpc

* fix compilation breaks

* Add the tunnel broker to the network

* fix broker id

* continue to be backwards compatible in the protocol
2019-11-25 16:31:43 +00:00
Asim Aslam
cffa5b6b50 Make use of cloudflare 1.0.0.1 by default to resolve addresses 2019-11-12 15:46:30 +00:00
Till Knuesting
5ae3e179b9 preallocated slices (#934) 2019-11-11 00:03:51 +00:00
Till Knuesting
f67c5e779f preallocated slices (#917) 2019-11-05 17:43:12 +00:00
Till Knuesting
24b8d2a315 preallocating slices (#904)
* preallocated some slices when size is known

* gofmt

* gofmt
2019-11-04 10:33:53 +00:00
Asim Aslam
45cd14c4b7 Suppress log messages 2019-11-03 16:12:17 +00:00
Asim Aslam
174fbde049 add ability to filter routes based on headers 2019-10-31 22:34:06 +00:00
Asim Aslam
d89256d8d5 add network resolver record priority field 2019-10-28 15:31:46 +00:00
Asim Aslam
b42d242ec1 hash address based on service name + node address 2019-10-25 23:06:49 +01:00
Asim Aslam
f26d470db1 A few changes for the network / tunnel link state 2019-10-24 17:51:41 +01:00
Milos Gajdos
4f1dd3f965
Fixed a small messup when printing logs 2019-10-23 20:01:45 +01:00
Milos Gajdos
71122836b8
Use event.Route.Link for getting the route metrics 2019-10-23 19:55:01 +01:00
Milos Gajdos
b67be88952
Check for local links and empty gateways 2019-10-23 19:48:26 +01:00
Milos Gajdos
776284b187
Make sure you dont overflow MaxInt64 2019-10-23 17:42:04 +01:00
Milos Gajdos
35729092e0
Unexport network.Message 2019-10-23 17:32:45 +01:00
Milos Gajdos
68789af4ea
Prune peerlinks of pruned nodes 2019-10-23 17:29:03 +01:00
Milos Gajdos
b3d4a7f740
If no link found, return max possible value 2019-10-23 16:51:22 +01:00
Milos Gajdos
f4f178c130
Set metric on egress. Increment metric on ingress. 2019-10-23 16:51:22 +01:00
Milos Gajdos
1ff65e140a
Change router.Route metric to int64. Set the route metric properly 2019-10-23 16:51:22 +01:00
Milos Gajdos
326156671d
Set route metric to link Length 2019-10-23 16:51:22 +01:00
Milos Gajdos
6353b2b894
Keep track of peer links 2019-10-23 16:51:22 +01:00
Milos Gajdos
3d5d9be02a
Avoid recursive calls to RLock()
Topology calls itsel recursively invoking RLock. This, according to go
documentation is wrong. This commit moves the body of Topology function
to a non-thread safe unexported function to keep locsk at check!
2019-10-18 11:26:43 +01:00
Asim Aslam
5c38f38dd9
No need to lock here since Topology read locks and makes copies 2019-10-18 11:26:43 +01:00
Milos Gajdos
2ae583ce94
Cleanup of tunnel dial code. Clean up network channel processors 2019-10-16 20:44:22 +01:00
Asim Aslam
b1d5dc20fa
Merge pull request #860 from micro/tunnel-mode
Tunnel mode
2019-10-15 16:14:38 +01:00