diff --git a/model/project_parser.go b/model/project_parser.go index b7507f6957..8d232f6d58 100644 --- a/model/project_parser.go +++ b/model/project_parser.go @@ -162,36 +162,6 @@ func (pp *ParserProject) MarshalBSON() ([]byte, error) { return mgobson.Marshal(pp) } -// RetryMarshalBSON marshals the BSON and attempts to unmarshal it back to make sure -// it is valid. It only retries when it fails at reading the BSON, not if it encountered -// an error while marshalling. -func (pp *ParserProject) RetryMarshalBSON(retries int) ([]byte, error) { - return pp.retryMarshalBSON(retries, retries) -} - -func (pp *ParserProject) retryMarshalBSON(maxRetries, retries int) ([]byte, error) { - projBytes, err := bson.Marshal(pp) - if err != nil { - return nil, errors.Wrap(err, "marshalling project") - } - _, err = GetProjectFromBSON(projBytes) - if err != nil { - if retries > 0 { - return pp.retryMarshalBSON(maxRetries, retries-1) - } - return nil, errors.Wrap(err, "unmarshalling project to verify it's integrity") - } - // TODO (DEVPROD-12560): Remove this log line, potentially the whole retry if it's - // never been logged since that means the retries are never actually happening. - if retries < maxRetries { - grip.Debug(message.Fields{ - "message": "parser project marshalling succeeded after retries", - "retries": maxRetries - retries, - }) - } - return projBytes, nil -} - func (pp *ParserProject) MarshalYAML() (interface{}, error) { for i, pt := range pp.Tasks { for j := range pt.Commands { diff --git a/model/project_parser_test.go b/model/project_parser_test.go index 98686bed8f..7fc3225e49 100644 --- a/model/project_parser_test.go +++ b/model/project_parser_test.go @@ -2990,7 +2990,7 @@ func TestMarshalBSON(t *testing.T) { Identifier: utility.ToStringPtr("small"), } - encoded, err := pp.RetryMarshalBSON(5) + encoded, err := pp.MarshalBSON() require.NoError(t, err) require.NotEmpty(t, encoded) diff --git a/rest/route/agent.go b/rest/route/agent.go index 664d5d2e83..74387db143 100644 --- a/rest/route/agent.go +++ b/rest/route/agent.go @@ -587,7 +587,7 @@ func (h *getParserProjectHandler) Run(ctx context.Context) gimlet.Responder { Message: fmt.Sprintf("parser project '%s' not found", v.Id), }) } - projBytes, err := pp.RetryMarshalBSON(5) + projBytes, err := pp.MarshalBSON() if err != nil { return gimlet.MakeJSONInternalErrorResponder(errors.Wrap(err, "marshalling project bytes to bson")) }