Skip to content

Commit

Permalink
Merge pull request #8 from siemens/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
thediveo authored Jan 13, 2024
2 parents 98d9683 + 419f1fd commit 41c00dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions socketactivator.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,22 @@ func (s *socketActivatorProcess) activateAndWatch(
// through the proc filesystem "root" element "wormholes".
wormhole := "/proc/" + strconv.FormatUint(uint64(s.proc.PID), 10) + "/root"
for ino, api := range apis {
if api == "" {
continue
}
idx := slices.IndexFunc(s.demonDetectorPlugins, func(f *demonFinderPlugin) bool {
return strings.HasSuffix(api, f.ident.APIEndpointSuffix)
})
if idx < 0 {
continue
}
api, err := procfsroot.EvalSymlinks(api, wormhole, procfsroot.EvalFullPath)
apieval, err := procfsroot.EvalSymlinks(api, wormhole, procfsroot.EvalFullPath)
if err != nil {
log.Errorf("invalid API endpoint path %s in context of %s",
log.Errorf("invalid API endpoint path '%s' in context of '%s'",
api, wormhole)
continue
}
api = wormhole + api
api = wormhole + apieval
wg.Add(1)
ctx := s.contexter()
go func(ino uint64, api string, enginename string, creatorfn func(apipath string, pid model.PIDType) (watcher.Watcher, error)) {
Expand Down
4 changes: 4 additions & 0 deletions watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func activateAndStartWatch(
if err != nil {
return
}
if w == nil {
err = fmt.Errorf("no '%s' watcher for API endpoint %s", enginename, apipath)
return
}
remmaxwait := maxwait - time.Since(started)
if remmaxwait < 0 {
remmaxwait = 0
Expand Down

0 comments on commit 41c00dc

Please sign in to comment.