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

WorkerConnection freezes due to racecondition. #56

Open
lath opened this issue Jan 9, 2015 · 3 comments
Open

WorkerConnection freezes due to racecondition. #56

lath opened this issue Jan 9, 2015 · 3 comments
Assignees
Labels

Comments

@lath
Copy link

lath commented Jan 9, 2015

Hello.

I've noticed that the worker-connection sometimes freezes.
The reason for this is an unhandled io.ErrShortWrite error caused inside agent.write().

The writer throws this error when a worker-go-routine writes "dtWorkComplete" just after the main-thread receives a "dtNoop" but before sending "dtPreSleep".
In other words:

dtNoop
dtWorkComplete
dtPreSleep

This causes the issue because the go-routine is missing a synclock inside worker.exec().
I've solved this by changing:

inpack.a.write(outpack)

into

inpack.a.Lock()
err := inpack.a.write(outpack)
inpack.a.Unlock()
@parkr
Copy link

parkr commented Sep 18, 2015

Is this closed?

@mikespook
Copy link
Owner

Already fixed, but I think it still needs more testing.

@lath
Copy link
Author

lath commented Sep 21, 2015

I have not updated my codebase for a long time but the patch has worked for me without any problems since I implemented it.

Best regards

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

No branches or pull requests

3 participants