Skip to content

ServeConfig supports a manual listener - #140

Merged
mitchellh merged 3 commits into
masterfrom
manual-listener
Apr 7, 2020
Merged

ServeConfig supports a manual listener#140
mitchellh merged 3 commits into
masterfrom
manual-listener

Conversation

@mitchellh

Copy link
Copy Markdown
Contributor

This lets the plugin more carefully control the address it wants to
listen on. This is an advanced use case and not typically necessary.
However, it has its uses if you want to force a plugin to serve on a
specific network.

This lets the plugin more carefully control the address it wants to
listen on. This is an advanced use case and not typically necessary.
However, it has its uses if you want to force a plugin to serve on a
specific network.

@apparentlymart apparentlymart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the general idea of this. I have a question inline about one specific detail, but it's not a super-important one.

Comment thread server.go Outdated

@paddycarver paddycarver left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This makes sense to me, and seems like it would address my use case. I agree with Martin's comment about ownership of the listener.

But I think I could build a ReattachConfig from a server process by recording the PID of the process, passing in a listener and using it as the source of the net.Addr, and just reimplementing protocolVersion or hardcoding grpc. Which then gets me what I need to have Terraform attach to a delve-wrapped plugin.

So as long as Martin is cool with this approach (as I'll be trying to merge it into Terraform), it works for me.

@mitchellh

Copy link
Copy Markdown
Contributor Author

Done!

@mitchellh
mitchellh merged commit 056b96f into master Apr 7, 2020
@mitchellh
mitchellh deleted the manual-listener branch April 7, 2020 17:36
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.

3 participants