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

Reproduce and fix the problem with suspended overrides being delivered simultaneously #94

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jakzal
Copy link
Member

@jakzal jakzal commented Dec 14, 2021

No description provided.

@jakzal jakzal force-pushed the suspended-overrides-order branch from fc30006 to 9ab4e66 Compare December 14, 2021 21:35
mailbox.send(message);
}

assertEquals(Arrays.asList(0, 1, 2), actor.testResults.getCounts());
Copy link
Member Author

@jakzal jakzal Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing with: expected:<[0, 1, 2]> but was:<[1, 2, 0]>

Error:  Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.455 s <<< FAILURE! - in io.vlingo.xoom.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailboxTest
Error:  testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived(io.vlingo.xoom.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailboxTest)  Time elapsed: 0.117 s  <<< FAILURE!
java.lang.AssertionError: expected:<[0, 1, 2]> but was:<[1, 2, 0]>
	at io.vlingo.xoom.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailboxTest.testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived(ConcurrentQueueMailboxTest.java:113)

@Test
public void testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived() {

final Dispatcher dispatcher = new ExecutorDispatcher(2, 0, 1.0f);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that the number of threads needs to be at least 2 for this test to fail.

@jakzal jakzal changed the title Reproduce the problem with suspended overrides being delivered simultaneously Reproduce and fix the problem with suspended overrides being delivered simultaneously Dec 14, 2021
@jakzal jakzal force-pushed the suspended-overrides-order branch from 8bbccfd to 780c3cc Compare December 14, 2021 22:39
return queue.poll();
} else {
return suspendedDeliveryQueue.get().poll();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed receive() to also look at the suspended delivery queue. This is a public method so I'm not 100% sure I should've done it...

@jakzal jakzal force-pushed the suspended-overrides-order branch from 7a6b1c0 to 3ebaae3 Compare January 10, 2022 13:16
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

Successfully merging this pull request may close these issues.

1 participant