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

Clear Queue bug #120

Open
cwinsnes opened this issue May 12, 2014 · 4 comments
Open

Clear Queue bug #120

cwinsnes opened this issue May 12, 2014 · 4 comments
Assignees
Labels

Comments

@cwinsnes
Copy link
Contributor

If you are in a queue that gets cleared by a queue owner, trying to queue in another queue before refreshing the page results in a warning that you are already in a queue.

@cwinsnes cwinsnes self-assigned this May 12, 2014
@cwinsnes
Copy link
Contributor Author

https://github.com/mvk13ogb/qwait/tree/clearqueuebugfix seems to solve the problem but I think the solution is kind of ugly.

@dflemstr, is there any better way of doing this that you can think of?

@dflemstr
Copy link
Member

@cwinsnes try to reuse the existing methods on the ApiProviderImpl for removing queue positions, instead of re-implementing the functionality in this method. E.g. call deleteQueuePosition(...)

@cwinsnes
Copy link
Contributor Author

I changed the code so that it removes every queue position using deleteQueuePosition. Does that look better?

I also removed the message on the message bus that said QueueCleared since everyone already is removed when having iterated through the list, but that could of course be readded if there is another reason to do this.

There is a race condition in this code though, since someone could join the queue while the queue is getting cleared. Could that me remedied by locking the queue before the loop and unlocking after or should something else be done about that?

@dflemstr
Copy link
Member

The SQL transaction ensures that nobody can join the queue while it is being cleared.

The idea was that the QueueCleared message should replace the mass queue position removal messages... That is still a possible solution of course but you seem to prefer sending multiple messages which should be fine too...

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