Skip to content

[wip] etcd: Connection options (socket file, ipv6)#343

Closed
aequitas wants to merge 2 commits intopurpleidea:masterfrom
aequitas:unix-domain-sockets
Closed

[wip] etcd: Connection options (socket file, ipv6)#343
aequitas wants to merge 2 commits intopurpleidea:masterfrom
aequitas:unix-domain-sockets

Conversation

@aequitas
Copy link
Contributor

@aequitas aequitas commented Feb 19, 2018

Changes:

  • Allow unix domain socket to be used as client url
  • Using ::1 as clienturl should not create default local ipv4 listener: http://[::1]:

Todos:

  • fix gprc warning
  • tests

Currently this allows a mgmt instance to be started with no TCP ports opened, eg using:

./mgmt run --prefix tmp/ --client-urls=unix://clients.sock:0 --server-urls=unix://servers.sock:0

And run mgmt deploy utilising the socket connection (deploy needs to be run from prefix directory).

Only problems I still need to solve is related to gprc:

WARNING: 2018/02/19 21:35:35 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup clients.sock: no such host"; Reconnecting to {clients.sock:0 0  <nil>}

I have been debugging for a while now and still unsure why this happens.

@aequitas aequitas changed the title etcd: Connection options (socket file, ipv6) [wip] etcd: Connection options (socket file, ipv6) Feb 19, 2018
@aequitas
Copy link
Contributor Author

~/.g/s/g/p/mgmt (unix-domain-sockets|…1) $ ./mgmt run --prefix tmp/ --client-urls=unix://clients.sock:0 --server-urls=unix://servers.sock:0
21:57:33 hello.go:46: This is: mgmt, version: 0.0.14-44-g245e927-dirty
21:57:33 hello.go:47: Main: Start: 1519073853401088759
21:57:33 main.go:239: Main: Working prefix is: tmp/
21:57:34 pgp.go:88: PGP: Created key: 7A8E7BBD
21:57:34 main.go:332: Main: Seeds: No seeds specified!
21:57:34 etcd.go:416: Etcd: Bootstrapping...
21:57:34 etcd.go:1444: Etcd: Nominated: Firefly.local=unix://servers.sock:0
21:57:34 etcd.go:1459: Etcd: StartServer(newCluster: true): Firefly.local=unix://servers.sock:0
21:57:34 etcd.go:331: Etcd: Connect: Endpoints: []
21:57:34 etcd.go:345: Etcd: Connect: CtxError...
21:57:34 etcd.go:625: Etcd: CtxError: Reason: CtxDelayErr(1s): No endpoints available yet!
21:57:34 etcd.go:1734: Etcd: StartServer: Starting server...
21:57:34 etcd.go:1741: Etcd: StartServer: Done starting server!
21:57:34 etcd.go:1759: Etcd: StartServer: Server running...
21:57:34 etcd.go:1482: Etcd: Addresses are: unix://clients.sock:0
WARNING: 2018/02/19 21:57:34 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup clients.sock: no such host"; Reconnecting to {clients.sock:0 0  <nil>}
21:57:35 etcd.go:329: Etcd: Connect: Endpoints: Firefly.local=unix://clients.sock:0
21:57:35 etcd.go:436: Etcd: Startup: Volunteering...
21:57:35 etcd.go:1650: Etcd: Ideal cluster size is now: 5
21:57:35 etcd.go:1003: Etcd: Set(/_mgmt/idealClusterSize): &{cluster_id:17999238359325543735 member_id:15069289683776423441 revision:4 raft_term:2  <nil>}
21:57:35 etcd.go:1244: Etcd: Members: List: [Firefly.local]
21:57:35 etcd.go:1267: Etcd: Leader: Firefly.local
21:57:35 etcd.go:1286: Etcd: Volunteers: [Firefly.local]
21:57:35 etcd.go:1290: Etcd: Quitters: []
21:57:35 etcd.go:1302: Etcd: Candidates: []
21:57:35 etcd.go:1244: Etcd: Members: List: [Firefly.local]
21:57:35 etcd.go:1267: Etcd: Leader: Firefly.local
21:57:35 etcd.go:1286: Etcd: Volunteers: [Firefly.local]
21:57:35 etcd.go:1290: Etcd: Quitters: []
21:57:35 etcd.go:1302: Etcd: Candidates: []
WARNING: 2018/02/19 21:57:35 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup clients.sock: no such host"; Reconnecting to {clients.sock:0 0  <nil>}
21:57:36 main.go:431: Main: Waiting...
21:57:36 main.go:721: Main: Remotes: Run: Ready!
21:57:36 main.go:808: Main: Running...
WARNING: 2018/02/19 21:57:37 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup clients.sock: no such host"; Reconnecting to {clients.sock:0 0  <nil>}
WARNING: 2018/02/19 21:57:39 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup clients.sock: no such host"; Reconnecting to {clients.sock:0 0  <nil>}
Job 4, './mgmt run --prefix tmp/ --clie…' has stopped
~/.g/s/g/p/mgmt (unix-domain-sockets|…1) $
~/.g/s/g/p/mgmt (unix-domain-sockets|…1) $ bg
Send job 4 './mgmt run --prefix tmp/ --client-urls=unix://clients.sock:0 --server-urls=unix://servers.sock:0' to background
WARNING: 2018/02/19 21:57:54 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup clients.sock: no such host"; Reconnecting to {clients.sock:0 0  <nil>}
~/.g/s/g/p/mgmt (unix-domain-sockets|…1) $ ./mgmt deploy --no-git --seeds unix://clients.sock:0 lang --lang examples/lang/load0.mcl
21:57:56 hello.go:46: This is: mgmt deploy, version: 0.0.14-44-g245e927-dirty
21:57:56 hello.go:47: Main: Start: 1519073876327716675
21:57:56 deploy.go:125: Deploy: Previous deploy id: 0
21:57:56 deploy.go:155: Deploy: Success, id: 1
21:57:56 main.go:431: Main: Waiting...
21:57:56 gapi.go:212: lang: Generating new graph...
21:57:56 gapi.go:216: lang: Swap!
21:57:56 lang.go:80: lang: Lexing/Parsing...
21:57:56 lang.go:95: lang: Interpolating...
21:57:56 lang.go:112: lang: Building Scope...
21:57:56 lang.go:124: lang: Running Type Unification...
21:57:56 lang.go:129: lang: Building Function Graph...
21:57:56 lang.go:171: lang: Function Engine Initializing...
21:57:56 lang.go:176: lang: Function Engine Validating...
21:57:56 lang.go:181: lang: Function Engine Starting...
21:57:56 lang.go:166: lang: funcs: func `str(x15)` started
21:57:56 lang.go:166: lang: funcs: func `str(x15)` changed
21:57:56 lang.go:190: lang: Stream...
21:57:56 lang.go:194: lang: Loop...
21:57:56 lang.go:166: lang: funcs: func `str(x15)` stopped
21:57:56 lang.go:166: lang: funcs: func `call:load()` started
21:57:56 lang.go:166: lang: funcs: func `call:load()` changed
21:57:56 lang.go:166: lang: funcs: func `var(theload)` started
21:57:56 lang.go:166: lang: funcs: func `var(theload)` changed
21:57:56 lang.go:166: lang: funcs: func `var(theload)` started
21:57:56 lang.go:166: lang: funcs: func `var(theload)` changed
21:57:56 lang.go:166: lang: funcs: func `var(theload)` started
21:57:56 lang.go:166: lang: funcs: func `var(theload)` changed
21:57:56 lang.go:166: lang: funcs: func `str(x1)` started
21:57:56 lang.go:166: lang: funcs: func `str(load average: %f, %f, %f)` started
21:57:56 lang.go:166: lang: funcs: func `str(load average: %f, %f, %f)` changed
21:57:56 lang.go:166: lang: funcs: func `str(load average: %f, %f, %f)` stopped
21:57:56 lang.go:166: lang: funcs: func `str(x1)` changed
21:57:56 lang.go:166: lang: funcs: func `str(x1)` stopped
21:57:56 lang.go:166: lang: funcs: func `call:structlookup(var(theload), str(x1))` started
21:57:56 lang.go:166: lang: funcs: func `call:structlookup(var(theload), str(x1))` changed
21:57:56 lang.go:166: lang: funcs: func `str(x5)` started
21:57:56 lang.go:166: lang: funcs: func `str(x5)` changed
21:57:56 lang.go:166: lang: funcs: func `var(x1)` started
21:57:56 lang.go:166: lang: funcs: func `var(x1)` changed
21:57:56 lang.go:166: lang: funcs: func `call:structlookup(var(theload), str(x5))` started
21:57:56 lang.go:166: lang: funcs: func `call:structlookup(var(theload), str(x15))` started
21:57:56 lang.go:166: lang: funcs: func `call:structlookup(var(theload), str(x15))` changed
21:57:56 lang.go:166: lang: funcs: func `str(x5)` stopped
21:57:56 lang.go:166: lang: funcs: func `call:structlookup(var(theload), str(x5))` changed
21:57:56 lang.go:166: lang: funcs: func `var(x15)` started
21:57:56 lang.go:166: lang: funcs: func `var(x15)` changed
21:57:56 lang.go:166: lang: funcs: func `str(print1)` started
21:57:56 lang.go:166: lang: funcs: func `str(print1)` changed
21:57:56 lang.go:166: lang: funcs: func `str(print1)` stopped
21:57:56 lang.go:166: lang: funcs: func `var(x5)` started
21:57:56 lang.go:166: lang: funcs: func `var(x5)` changed
21:57:56 lang.go:166: lang: funcs: func `call:printf(str(load average: %f, %f, %f), var(x1), var(x5), var(x15))` started
21:57:56 lang.go:166: lang: funcs: func `call:printf(str(load average: %f, %f, %f), var(x1), var(x5), var(x15))` changed
21:57:56 gapi.go:212: lang: Generating new graph...
21:57:56 lang.go:247: lang: Running interpret...
21:57:56 main.go:584: Main: GraphSync...
21:57:56 autoedge.go:92: Compile: Adding AutoEdges...
21:57:56 autoedge.go:109: print[print1]: No auto edges were found!
21:57:56 autogroup.go:352: Compile: Grouping: Algorithm: NonReachabilityGrouper...
21:57:56 mgraph.go:99: State: 0 -> 1
21:57:56 mgraph.go:162: print[print1]: Started
21:57:56 mgraph.go:182: State: 1 -> 2
21:57:56 main.go:655: Main: Graph: Vertices(1), Edges(0)
21:57:56 main.go:431: Main: Waiting...
21:57:56 print.go:85: print[print1]: CheckApply: true
21:57:56 print.go:89: print[print1]: Msg: load average: 1.69140625, 1.49609375, 1.4345703125

@aequitas
Copy link
Contributor Author

Awaiting: grpc/grpc-go#1741 (comment)

Grpc seems to be hardcoded to "tcp".

Functional wise unix domain sockets work well. I still have to run more extensive tests, but deployment of examplex/lang/states0.mcl produced expected output.

@aequitas
Copy link
Contributor Author

In other news, functional wise unix domain sockets work even with the grpc warnings.

@aequitas
Copy link
Contributor Author

Raised issue at etcd: etcd-io/etcd#9340

@aequitas aequitas force-pushed the unix-domain-sockets branch from 245e927 to 7b178e9 Compare February 23, 2018 22:27
@aequitas
Copy link
Contributor Author

This PR currently included integrationtest commit as it is a prerequisite for the domain socket test.

@aequitas aequitas force-pushed the unix-domain-sockets branch from 7b178e9 to bed6eae Compare February 23, 2018 22:37
@aequitas aequitas changed the title [wip] etcd: Connection options (socket file, ipv6) etcd: Connection options (socket file, ipv6) Feb 23, 2018
@aequitas
Copy link
Contributor Author

Tests seem to prove this is functional even with the gprc error.

@aequitas aequitas force-pushed the unix-domain-sockets branch 5 times, most recently from 35f0a3c to 71ea635 Compare February 24, 2018 22:01
@aequitas aequitas changed the title etcd: Connection options (socket file, ipv6) [wip] etcd: Connection options (socket file, ipv6) Feb 26, 2018
@aequitas aequitas force-pushed the unix-domain-sockets branch from 71ea635 to 75f323e Compare February 26, 2018 13:21
@aequitas
Copy link
Contributor Author

aequitas commented Feb 26, 2018

This should currently not be merged, I added a commit to test with changes by @hexfusion that should resolve the grpc warnings: etcd-io/etcd#9354

Removed that commit again as it did not build a proper binary, probably due to changes in how etcd handles dependencies now since v3.3.1.

aequitas added 2 commits March 5, 2018 17:16
- Allow unix domain socket to be used as client url
- Using ::1 as clienturl should not create default local ipv4 listener
- Add shell testsuite that runs using unix domain sockets
@aequitas aequitas force-pushed the unix-domain-sockets branch from 5754903 to 2113d0c Compare March 5, 2018 16:17
@aequitas
Copy link
Contributor Author

#368 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant