Skip to content

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

Draft
jakzal wants to merge 4 commits into
masterfrom
suspended-overrides-order
Draft

Reproduce and fix the problem with suspended overrides being delivered simultaneously#94
jakzal wants to merge 4 commits into
masterfrom
suspended-overrides-order

Conversation

@jakzal
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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...

…aneously

Signed-off-by: Jakub Zalas <jakub@zalas.pl>
Signed-off-by: Jakub Zalas <jakub@zalas.pl>
Signed-off-by: Jakub Zalas <jakub@zalas.pl>
… resume

Signed-off-by: Jakub Zalas <jakub@zalas.pl>
@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