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

Correct Windows plugin restart when Reattach info is stale #6092

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions helper/pluginutils/singleton/singleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ func (s *SingletonLoader) getPlugin(reattach bool, name, pluginType string, logg
s.instanceLock.Unlock()

i, err := f.wait().result()
if err != nil {

if (err == nil && i.Exited()) || err == plugin.ErrProcessNotFound {
// On Windows, a stale pid in Reattach info results in ErrProcessNotFound
s.clearFuture(id, f)
return nil, err
return nil, SingletonPluginExited
}

if i.Exited() {
if err != nil {
s.clearFuture(id, f)
return nil, SingletonPluginExited
return nil, err
}

return i, nil
Expand Down
5 changes: 4 additions & 1 deletion vendor/github.com/hashicorp/go-plugin/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.