Retry Environment Recovery
This commit is contained in:

committed by
Sebastian Serth

parent
89c18ad45c
commit
73759f8a3c
@ -245,7 +245,7 @@ func (n *NomadEnvironment) Sample() (runner.Runner, bool) {
|
||||
r, ok := n.idleRunners.Sample()
|
||||
if ok && n.idleRunners.Length() < n.PrewarmingPoolSize() {
|
||||
go func() {
|
||||
err := util.RetryExponential(time.Second, func() error {
|
||||
err := util.RetryExponential(func() error {
|
||||
return n.createRunner(false)
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
"github.com/openHPI/poseidon/pkg/logging"
|
||||
"github.com/openHPI/poseidon/pkg/monitoring"
|
||||
"github.com/openHPI/poseidon/pkg/storage"
|
||||
"github.com/openHPI/poseidon/pkg/util"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
@ -42,7 +43,7 @@ func NewNomadEnvironmentManager(
|
||||
|
||||
m := &NomadEnvironmentManager{&AbstractManager{nil, runnerManager},
|
||||
apiClient, templateEnvironmentJobHCL}
|
||||
if err := m.Load(); err != nil {
|
||||
if err := util.RetryExponential(func() error { return m.Load() }); err != nil {
|
||||
log.WithError(err).Error("Error recovering the execution environments")
|
||||
}
|
||||
runnerManager.Load()
|
||||
|
Reference in New Issue
Block a user