Skip to content

Commit

Permalink
Merge 34a34e7 into backport/b-ping-logmon-process-on-reattach/quietly…
Browse files Browse the repository at this point in the history
…-rational-owl
  • Loading branch information
hc-github-team-nomad-core authored Jan 8, 2025
2 parents a651e82 + 34a34e7 commit 3f1f6a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/24798.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
drivers: validate logmon plugin during reattach
```
10 changes: 10 additions & 0 deletions client/logmon/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ func LaunchLogMon(logger hclog.Logger, reattachConfig *plugin.ReattachConfig) (L
return nil, nil, err
}

// Note: Similar to reattaching to executors, Go-plugin uses localhost
// ports on Windows. On reattach, it may attach to another process
// listening on that port. We should validate it is actually a plugin.
if conf.Reattach != nil {
if err := rpcClient.Ping(); err != nil {
logger.Warn("failed to ping plugin process during reattach", "error", err)
return nil, nil, err
}
}

l := raw.(LogMon)
return l, client, nil
}
Expand Down

0 comments on commit 3f1f6a0

Please sign in to comment.