v1.27.0-a #10

Closed
jonathanface wants to merge 473 commits from v1.27.0-a into master
3 changed files with 12 additions and 2 deletions
Showing only changes of commit 93fd408267 - Show all commits

View File

@ -146,6 +146,11 @@ func New(
TaskTypeDetails: c.TypeDetails(), TaskTypeDetails: c.TypeDetails(),
TaskEngine: e, TaskEngine: e,
} }
if len(h.Name) > 16 {
return nil, fmt.Errorf("task name too long: %s, max 16 characters", h.Name)
}
e.handlers = append(e.handlers, &h) e.handlers = append(e.handlers, &h)
e.taskMap[h.TaskTypeDetails.Name] = &h e.taskMap[h.TaskTypeDetails.Name] = &h
} }

View File

@ -354,7 +354,7 @@ func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageS
for { for {
var err error var err error
var sigCidStr, sendError string var sigCidStr, sendError *string
var sendSuccess *bool var sendSuccess *bool
err = s.db.QueryRow(ctx, `select signed_cid, send_success, send_error from message_sends where send_task_id = $1`, &sendTaskID).Scan(&sigCidStr, &sendSuccess, &sendError) err = s.db.QueryRow(ctx, `select signed_cid, send_success, send_error from message_sends where send_task_id = $1`, &sendTaskID).Scan(&sigCidStr, &sendSuccess, &sendError)
@ -373,6 +373,11 @@ func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageS
continue continue
} }
if sigCidStr == nil || sendError == nil {
// should never happen because sendSuccess is already not null here
return cid.Undef, xerrors.Errorf("got null values for sigCidStr or sendError, this should never happen")
}
if !*sendSuccess { if !*sendSuccess {
sendErr = xerrors.Errorf("send error: %s", sendError) sendErr = xerrors.Errorf("send error: %s", sendError)
} else { } else {

View File

@ -217,7 +217,7 @@ func (w *WdPostRecoverDeclareTask) CanAccept(ids []harmonytask.TaskID, engine *h
func (w *WdPostRecoverDeclareTask) TypeDetails() harmonytask.TaskTypeDetails { func (w *WdPostRecoverDeclareTask) TypeDetails() harmonytask.TaskTypeDetails {
return harmonytask.TaskTypeDetails{ return harmonytask.TaskTypeDetails{
Max: 128, Max: 128,
Name: "WdPostRecoverDeclare", Name: "WdPostRecover",
Cost: resources.Resources{ Cost: resources.Resources{
Cpu: 1, Cpu: 1,
Gpu: 0, Gpu: 0,