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

plugin: changing the plugin code and re-compiling it, the new changes do not add up #33230

Closed
Shivam010 opened this issue Jul 22, 2019 · 7 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@Shivam010
Copy link

On changing the plugin code and re-compiling it, the new changes do not add up on opening the newly generated .so file, using plugin.Open

Follow the code in main.go or run the docker image

What version of Go are you using (go version)?

$ go version
go version go1.12.6 linux/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build277122299=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Follow the code and process in the repository

What did you expect to see?

Link

What did you see instead?

Link

Hot Fix

Build the plugins with a unique name for .so files, i.e. explicitly generate a new so File instead of overwriting the file for the same name

@ianlancetaylor
Copy link
Contributor

What do you mean by "do not add up"?

@AlexRouSg
Copy link
Contributor

AlexRouSg commented Jul 22, 2019

@ianlancetaylor from looking at his main.go and expected output. It looks like he expects to be able to hot reload plugins.

@Shivam010 Plugins cannot be unloaded so there is no way to do what you want except to open a new plugin with a different name every time.

You can follow #20461

@Shivam010
Copy link
Author

Thank you @AlexRouSg
It means that the only way to do what I am doing is to use different names for the plugin.

@julieqiu julieqiu added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 29, 2019
@julieqiu
Copy link
Member

@Shivam010 - does @AlexRouSg's suggestion answer the question?

@Shivam010
Copy link
Author

The suggestion turns out to be the same as what I had in my mind. So yes, it solves the problem, for now. I have gone through issue #20461 but am open for a more concrete solution for hot code reload on runtime.
Thanks again !!

@AlexRouSg
Copy link
Contributor

For better help finding a solution, please see https://github.com/golang/go/wiki/Questions

@agnivade
Copy link
Contributor

Thanks for confirming @Shivam010. I will go ahead and close the issue as there is no bug to fix here. For solutions on how to approach your issue, please reach out to the various forums in the link above. We primarily use the issue tracker for bug fixes and feature proposals. Thank you.

@golang golang locked and limited conversation to collaborators Jul 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants