Skip to content

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matoval committed Feb 28, 2025
1 parent 4de849a commit ad24a5f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
9 changes: 0 additions & 9 deletions pkg/workceptor/controlsvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,6 @@ func (c *workceptorCommand) ControlFunc(ctx context.Context, nc controlsvc.Netce
if err != nil {
return nil, err
}
if c.w.recentlyReleasedUnits[unitid] != "" {
c.w.nc.GetLogger().Debug("status called on recently released work unit")
cfr := make(map[string]interface{})
cfr["State"] = 3
cfr["Detail"] = "status called on recently released work unit"
cfr["StateName"] = "Failed"

return cfr, nil
}
cfr, err := c.w.unitStatusForCFR(unitid)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/workceptor/remote_work.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (rw *remoteUnit) monitorRemoteStatus(mw *utils.JobContext, forRelease bool)
}
if status[:5] == "ERROR" {
if strings.Contains(status, "unknown work unit") {
if forRelease || red.LocalReleased {
if !forRelease {
rw.GetWorkceptor().nc.GetLogger().Debug("Work unit %s on node %s is gone.\n", remoteUnitID, remoteNode)
rw.UpdateFullStatus(func(status *StatusFileData) {
status.State = WorkStateFailed
Expand Down
2 changes: 0 additions & 2 deletions pkg/workceptor/workceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type Workceptor struct {
workTypes map[string]*workType
activeUnitsLock *sync.RWMutex
activeUnits map[string]WorkUnit
recentlyReleasedUnits map[string]string
SigningKey string
SigningExpiration time.Duration
VerifyingKey string
Expand Down Expand Up @@ -86,7 +85,6 @@ func New(ctx context.Context, nc NetceptorForWorkceptor, dataDir string) (*Workc
workTypes: make(map[string]*workType),
activeUnitsLock: &sync.RWMutex{},
activeUnits: make(map[string]WorkUnit),
recentlyReleasedUnits: make(map[string]string),
SigningKey: "",
SigningExpiration: 5 * time.Minute,
VerifyingKey: "",
Expand Down
7 changes: 0 additions & 7 deletions pkg/workceptor/workunitbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,6 @@ func (bwu *BaseWorkUnit) Release(force bool) error {
defer bwu.w.activeUnitsLock.Unlock()
delete(bwu.w.activeUnits, bwu.unitID)

bwu.w.recentlyReleasedUnits[bwu.unitID] = bwu.unitID

// go func() {
// time.Sleep(time.Second * 10)
// delete(bwu.w.recentlyReleasedUnits, bwu.unitID)
// }()

return nil
}

Expand Down

0 comments on commit ad24a5f

Please sign in to comment.