Skip to content

concurrency issues#328

Merged
bbortt merged 2 commits into
feat/concurrency-issue-testsfrom
fix/concurrency-issues
Jul 2, 2025
Merged

concurrency issues#328
bbortt merged 2 commits into
feat/concurrency-issue-testsfrom
fix/concurrency-issues

Conversation

@bbortt
Copy link
Copy Markdown
Collaborator

@bbortt bbortt commented May 13, 2025

it may occur that two scenarios run at the same time (with only a millisecond off).
if that happens, the Stack implementation in ScenarioEndpoint does not respect FIFO order.

  • simulation 1 arrives
  • simulation 2 arrives
  • simulation 1 "finishes" - but stack reports result to simulation 2

with using a queue, theoretically, the problem could now occur the other way around.
but it's much more unlikely.

  • simulation 1 arrives
  • simulation 2 arrives
  • simulation 1 "finishes" - queue reports result to simulation 1

only if simulation 2 finishes before simulation 1 we do still have a problem.
since this only occurs in equal simulations, it's likely that time constraints are also equal.

also includes a dependency upgrade to citrus core v4.6.0.

@bbortt bbortt requested a review from tschlat May 13, 2025 05:03
@bbortt bbortt self-assigned this May 13, 2025
@bbortt bbortt changed the title concurrency issues Draft: concurrency issues May 13, 2025
@bbortt bbortt force-pushed the fix/concurrency-issues branch 3 times, most recently from f98ef9c to 40dc0a3 Compare May 13, 2025 12:49
it may occur that two scenarios run at the same time (with only a millisecond off).
if that happens, the `Stack` implementation in `ScenarioEndpoint` does not respect FIFO order.
the second message receives the output of the first.
@bbortt bbortt force-pushed the fix/concurrency-issues branch from 849c916 to 7d3d244 Compare May 26, 2025 11:59
@bbortt bbortt changed the base branch from main to feat/concurrency-issue-tests May 26, 2025 11:59
@bbortt bbortt force-pushed the fix/concurrency-issues branch from 7d3d244 to 39e67ff Compare June 1, 2025 15:03
this commit introduces a nice link between a scenario and its messages.
an object is being attached to the `TestContext` which is unique per scenario execution.
both the received `Message` as well as the response `Future` are contained in it.
@bbortt bbortt force-pushed the fix/concurrency-issues branch from 39e67ff to 9e8341e Compare July 2, 2025 13:53
@bbortt bbortt merged commit 6af2523 into feat/concurrency-issue-tests Jul 2, 2025
@bbortt bbortt deleted the fix/concurrency-issues branch July 2, 2025 13:57
@bbortt bbortt changed the title Draft: concurrency issues concurrency issues Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race Condition in ScenarioEndpoint Due to LIFO Stack

2 participants