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

"short write" errors #68

Open
bploetz opened this issue Oct 18, 2022 · 2 comments
Open

"short write" errors #68

bploetz opened this issue Oct 18, 2022 · 2 comments

Comments

@bploetz
Copy link

bploetz commented Oct 18, 2022

We started seeing this all of a sudden last night out of the blue:

error enqueueing update-profile job: error enqueueing job: short write
…cessors.(*Processor).HandleError (/opt/reward-service/processors/processor.go:34)
…lReceiptProcessor).Process (/opt/reward-service/processors/digital_receipt.go:230)
….func1 (/go/pkg/mod/github.com/contribsys/faktory_worker_go@v1.6.0/manager.go:47)
…tch (/go/pkg/mod/github.com/contribsys/faktory_worker_go@v1.6.0/middleware.go:19)
…cessOne (/go/pkg/mod/github.com/contribsys/faktory_worker_go@v1.6.0/runner.go:139)
…process (/go/pkg/mod/github.com/contribsys/faktory_worker_go@v1.6.0/runner.go:95)
                         runtime.goexit (/usr/local/go/src/runtime/asm_amd64.s:1581)

The code in question:

func enqueueUpdateProfileJob(newRelicTxn *newrelic.Transaction, receiptID string, jobClient jobs.Client) error {
	defer newRelicTxn.StartSegment("enqueueUpdateProfileJob").End()
	jobArgument := make(map[string]interface{})
	jobArgument["id"] = receiptID
	jobArgs := []interface{}{jobArgument}
	retry := 5
	updateProfileJob := faktory.NewJob("update-profile", jobArgs...)
	updateProfileJob.Queue = "profiles"
	updateProfileJob.ReserveFor = 60
	updateProfileJob.Retry = &retry

	jpperr := jobClient.Push(updateProfileJob)
	if jpperr != nil {
		return fmt.Errorf("error enqueueing job: %v", jpperr)
	}

	return nil
}
@mperham
Copy link
Contributor

mperham commented Oct 18, 2022

Can you provide the backtrace for jpperr?

@mperham
Copy link
Contributor

mperham commented Oct 18, 2022

This can happen if two goroutines are sharing the same jobClient.

https://stackoverflow.com/questions/66174520/how-to-solve-short-write-error-when-writing-to-csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants