Conversation
horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/TestServiceTest.java
Outdated
Show resolved
Hide resolved
c5c96c5 to
0d04c3e
Compare
| validateUpTo(variableId, fpHash, nextTimestamp); | ||
| //assume not last datapoint if we have found more | ||
| tryRunChangeDetection(variableId, testId, fingerprint, fpHash, notify); |
There was a problem hiding this comment.
I am not sure removing messageBus.executeForTest here is straightforward because we are heavily changing the behavior:
- Previous: on every dataset recalc we enqueue a recursive call
tryRunChangeDetectionwithexecuteForTestensuring that this is run after the dataset was processed and committed (i.e., the datapoint is created). Moreover theexecuteForTestguarantees only ONE processing will be executed for that test - New: we are likely increasing the lifespan of db transaction because of the recursion, since we are not offloading that execution to a different async worker. Moreover they will run concurrently and it is not guaranteed that the datapoints have been already created when processing others
| messageBus.executeForTest(testId, () -> { | ||
| startRecalculation(testId, notify, debug, clearDatapoints == null || clearDatapoints, from, to); | ||
| }); | ||
| startRecalculation(testId, notify, debug, clearDatapoints == null || clearDatapoints, from, to); |
There was a problem hiding this comment.
Removing executeForTest on this, won't guarantee we will execute only one recalculation at time, which was the previous behavior. Moreover the current expectation is that this method will return immediately and do not block (as this might be a very long process) and its status is monitored by the UI using another endpoint)
There was a problem hiding this comment.
Regarding one calculation, if we're doing more than one per testId, something else is wrong since that should not happen afaik?
Regarding it being a long running process, yes, that might be something we should consider, but I would rather us using the same approach for this (using amq) as we're doing for the other offloading we're doing.
69d5180 to
227ad9b
Compare
refactored calculateDatapoints and runChangeDetection removed calls to executeBlocking, only one useage of messageBus remaining
227ad9b to
af4f325
Compare
There was a problem hiding this comment.
Hi @stalep,
I did another quick round and from a correctness standpoint it seems working as expected but there are a couple of concerns:
- If you trigger the recalculation in the Change Detection tab you will see the bar will not progress (I believe because the progress is not properly tracked in the backend)
- The process of recalculating datasets (consuming messages) seems much much slower. This is my biggest concern, I am trying some tests locally with a prod db to compare before/after to have some broad numbers..
I can confirm this:
The main change that introduced this difference seems to be the removal of |
|
Yeah, I did notice some slowdown as well, thanks for confirming. Before I had the insight I had now, I wanted to make sure we did it "correct" as I thought the deadlock could be related to this. However, I now know it's related to the changer calculation and not a problem with doing the datapoint calculations in parallel. |
Exactly, removing the vertx.blabla calls (especially the
sure thing! |
Not always, but usually this will trigger a deadlock locally.