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

Loosing messages when using > 1 worker #14

Open
avlapp opened this issue Oct 23, 2022 · 2 comments
Open

Loosing messages when using > 1 worker #14

avlapp opened this issue Oct 23, 2022 · 2 comments

Comments

@avlapp
Copy link

avlapp commented Oct 23, 2022

func (conn *UDPConn) Serve(numWorkers int, dispatcher Dispatcher) error

When I set 8 workers instead of just 1, it seems I'm loosing message now and then. A list is returned and sometimes it doesn't have the right length. It didn't occur yet, when I've just 1 worker running. Will keep an eye on it, while using 1 worker.

edit: looks like a channel doesn't get drained properly, cause when it goes wrong, the list is one to short or one to long.

@avlapp
Copy link
Author

avlapp commented Oct 24, 2022

My current take is that it might not be a bug in scgolang/osc. Using multiple workers is possibly just making the order of delivery of the packages less reliable. UDP doesn't guarantee order of delivery I think and using multiple goroutines probably makes it worse. The list of messages I'm getting ends with a 'end sign', but it's probably delivered before the last item/msg in the list is send. TCP or using timestamps might solve this in the particular application.

@vlappa
Copy link

vlappa commented Sep 1, 2023

If I understand the followings comments right, the review of this patch isn't that positive:
#3

If this issue is true (problem could be on my side) and these patch comments are rightly interpreted, one could ask if it's worth the extra complexity of workers here. In general you want to keep the order of osc messages as it is I think (unless you use timestamps probably).

Needs investigation.

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