Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable dispatcher reconnection logic in Go infra #1854

Merged
merged 4 commits into from
Sep 19, 2018
Merged

Enable dispatcher reconnection logic in Go infra #1854

merged 4 commits into from
Sep 19, 2018

Conversation

scrye
Copy link
Contributor

@scrye scrye commented Sep 12, 2018

Also:

  • move snetproxy networking-related interfaces into snet
  • refactor out of SD and PS common networking functionality and move it into a new package infraenv

Fixes #1474.


This change is Reviewable

@scrye scrye self-assigned this Sep 12, 2018
Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7 of 22 files at r1.
Reviewable status: 7 of 22 files reviewed, all discussions resolved (waiting on @scrye)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 22 files at r1.
Reviewable status: 12 of 22 files reviewed, all discussions resolved (waiting on @scrye)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 22 files at r1.
Reviewable status: 17 of 22 files reviewed, all discussions resolved (waiting on @scrye)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 22 files at r1.
Reviewable status: 18 of 22 files reviewed, all discussions resolved (waiting on @scrye)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 22 files at r1.
Reviewable status: 19 of 22 files reviewed, all discussions resolved (waiting on @scrye)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 22 files at r1.
Reviewable status: 20 of 22 files reviewed, 1 unresolved discussion (waiting on @scrye)


go/lib/infra/infraenv/infraenv.go, line 58 at r1 (raw file):

func initNetworking(ia addr.IA, public, bind *snet.Addr, svc addr.HostSVC) (snet.Conn, error) {
	network, err := snet.NewNetwork(ia, "", "")

This doesn't allow the service to specify which sciond to connect to (obviously doesn't apply to sciond itself ;). The CSGO needs this, the PSGO will need it in the near future (for DRKey).

What about exporting initNetworking, and having it do snet.NewNetwork and snetproxy.NewProxyNetwork, and moving the Listen call into InitMessenger? That way you don't have a 5th argument to InitMessenger that it only uses to pass into initNetworking.

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 22 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @scrye)


go/path_srv/main.go, line 109 at r1 (raw file):

		return 1
	}
	topoAddress := topo.PS.GetById(config.General.ID)

Check that the result isn't nil.

Copy link
Contributor Author

@scrye scrye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @scrye and @kormat)


go/lib/infra/infraenv/infraenv.go, line 58 at r1 (raw file):

Previously, kormat (Stephen Shirley) wrote…

This doesn't allow the service to specify which sciond to connect to (obviously doesn't apply to sciond itself ;). The CSGO needs this, the PSGO will need it in the near future (for DRKey).

What about exporting initNetworking, and having it do snet.NewNetwork and snetproxy.NewProxyNetwork, and moving the Listen call into InitMessenger? That way you don't have a 5th argument to InitMessenger that it only uses to pass into initNetworking.

I think cutting down on the number of ifs we have in our main functions makes them a bit easier to read, so I think having one instead of two is a bit cleaner. It also reduces code duplication, as multiple services will only have one branch instead of two.

It also would make sense conceptually, as all the networking bits are hidden behind a single "Gimme a messenger" call.

As more flexibility is needed, the number of arguments will probably increase, but we can change to the Config object pattern we use in several other places.


go/path_srv/main.go, line 109 at r1 (raw file):

Previously, kormat (Stephen Shirley) wrote…

Check that the result isn't nil.

Done.

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @kormat and @scrye)


go/lib/infra/infraenv/infraenv.go, line 58 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

I think cutting down on the number of ifs we have in our main functions makes them a bit easier to read, so I think having one instead of two is a bit cleaner. It also reduces code duplication, as multiple services will only have one branch instead of two.

It also would make sense conceptually, as all the networking bits are hidden behind a single "Gimme a messenger" call.

As more flexibility is needed, the number of arguments will probably increase, but we can change to the Config object pattern we use in several other places.

The Config pattern probably makes sense. As i mentioned above, this will be needed as soon as the CS uses this, but i'm fine with it being done in a follow-up PR.


go/lib/infra/infraenv/infraenv.go, line 63 at r2 (raw file):

	}
	proxyNetwork := snetproxy.NewProxyNetwork(network)
	conn, err := proxyNetwork.ListenSCIONWithBindSVC("udp4", public, bind, svc, 0)

There should be a flag to enable/disable using the snet proxy, with it probably defaulting to false to start.

Copy link
Contributor Author

@scrye scrye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 20 of 27 files reviewed, 2 unresolved discussions (waiting on @kormat and @scrye)


go/lib/infra/infraenv/infraenv.go, line 58 at r1 (raw file):

Previously, kormat (Stephen Shirley) wrote…

The Config pattern probably makes sense. As i mentioned above, this will be needed as soon as the CS uses this, but i'm fine with it being done in a follow-up PR.

Ack.


go/lib/infra/infraenv/infraenv.go, line 63 at r2 (raw file):

Previously, kormat (Stephen Shirley) wrote…

There should be a flag to enable/disable using the snet proxy, with it probably defaulting to false to start.

Done.

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7 of 7 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@scrye scrye merged commit a660a4b into scionproto:master Sep 19, 2018
@scrye scrye deleted the pubpr-reconnect-sd-cs branch September 19, 2018 12:50
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.

2 participants