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

QC-779 Multiple mesos executor fix #613

Merged
merged 2 commits into from
Sep 19, 2024
Merged
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
2 changes: 1 addition & 1 deletion core/task/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ func makeTaskForMesosResources(

newTaskId := taskPtr.GetTaskId()

executor := state.executor
executor := state.CopyExecutorInfo()
executor.ExecutorID.Value = taskPtr.GetExecutorId()
envIdS := envId.String()

Expand Down
11 changes: 7 additions & 4 deletions core/task/schedulerstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/AliceO2Group/Control/common/logger/infologger"
"github.com/AliceO2Group/Control/core/controlcommands"
"github.com/AliceO2Group/Control/core/task/schedutil"
"github.com/gogo/protobuf/proto"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gogo/protobuf is deprecated though, can you try using a different one?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is the official one now: https://github.com/golang/protobuf

Copy link
Collaborator Author

@justonedev1 justonedev1 Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it will not work, see previous build error.. but this package is used in mesos, so we are using it either way inherently. So I don't mind using it for cloning an object, that is already created by this package in mesos

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I personally also don't mind using marshall and unmarshall because we are using it once per run and per offer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, since mesos brings it anyway, let's keep gogo/protobuf, thanks for checking.

"github.com/looplab/fsm"
mesos "github.com/mesos/mesos-go/api/v1/lib"
"github.com/mesos/mesos-go/api/v1/lib/backoff"
Expand Down Expand Up @@ -94,7 +95,6 @@ func NewScheduler(taskman *Manager, fidStore store.Singleton, shutdown func()) (
viper.GetFloat64("executorMemory")),
viper.GetDuration("mesosJobRestartDelay"),
)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -161,11 +161,10 @@ func NewScheduler(taskman *Manager, fidStore store.Singleton, shutdown func()) (
},
"leave_CONNECTED": func(_ context.Context, e *fsm.Event) {
log.Debug("leave_CONNECTED")

},
"before_NEW_ENVIRONMENT": func(_ context.Context, e *fsm.Event) {
log.Debug("before_NEW_ENVIRONMENT")
e.Async() //transition frozen until the corresponding fsm.Transition call
e.Async() // transition frozen until the corresponding fsm.Transition call
},
"enter_CONNECTED": func(_ context.Context, e *fsm.Event) {
log.Debug("enter_CONNECTED")
Expand Down Expand Up @@ -208,10 +207,14 @@ func (state *schedulerState) Start(ctx context.Context) {
if state.err != nil {
err = state.err
log.WithField("error", err.Error()).Debug("scheduler quit with error, main state machine GO_ERROR")
state.sm.Event(context.Background(), "GO_ERROR", err) //TODO: use error information in GO_ERROR
state.sm.Event(context.Background(), "GO_ERROR", err) // TODO: use error information in GO_ERROR
} else {
log.Debug("scheduler quit, no errors")
state.sm.Event(context.Background(), "EXIT")
}
}()
}

func (state *schedulerState) CopyExecutorInfo() *mesos.ExecutorInfo {
return proto.Clone(state.executor).(*mesos.ExecutorInfo)
}
Loading