Skip to content

Commit

Permalink
Fix pelican plugin bug no valid classads...
Browse files Browse the repository at this point in the history
This fixes the bug we were getting with the pelican plugin where we
would see the plugin exiting 0 but sending out `no valid classads`. The
issue was an error type being written out and bypassing
strconv.QuoteToASCII which would remove any inside quotes.

Also found a spot where we were getting a nil pointer dereference because we were
accessing data before an error check, fixed as well
  • Loading branch information
joereuss12 committed Mar 14, 2024
1 parent 4ef9c8d commit 9729e8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ func runPluginWorker(ctx context.Context, upload bool, workChan <-chan PluginTra
var tj *client.TransferJob
urlCopy := *transfer.url
tj, err = tc.NewTransferJob(&urlCopy, transfer.localFile, upload, false, client.WithAcquireToken(false), client.WithCaches(caches...))
jobMap[tj.ID()] = transfer
if err != nil {
return errors.Wrap(err, "Failed to create new transfer job")
}
jobMap[tj.ID()] = transfer

if err = tc.Submit(tj); err != nil {
return err
Expand All @@ -460,7 +460,7 @@ func runPluginWorker(ctx context.Context, upload bool, workChan <-chan PluginTra
developerData[fmt.Sprintf("ServerVersion%d", attempt.Number)] = attempt.ServerVersion
developerData[fmt.Sprintf("TransferTime%d", attempt.Number)] = attempt.TransferTime
if attempt.Error != nil {
developerData[fmt.Sprintf("TransferError%d", attempt.Number)] = attempt.Error
developerData[fmt.Sprintf("TransferError%d", attempt.Number)] = attempt.Error.Error()
}
}

Expand Down

0 comments on commit 9729e8e

Please sign in to comment.