-
Notifications
You must be signed in to change notification settings - Fork 0
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
Stop sa computation fixes #9
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Add some tests for computation cancel requests Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
…status remain when error occur' Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
5594bdc
to
2ee713b
Compare
Mono<Network> network = getNetwork(networkUuid); | ||
if (otherNetworkUuids.isEmpty()) { | ||
return network; | ||
} else { | ||
Mono<List<Network>> otherNetworks = Flux.fromIterable(otherNetworkUuids) | ||
.flatMap(this::getNetwork) | ||
.flatMap(uuid -> { | ||
if (resultUuid != null && cancelComputationRequests.get(resultUuid) != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually all these are done in parallel so can you remove this check which is not useful ? sorry for asking to add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return Mono.empty(); | ||
} | ||
|
||
LOGGER.info("Loading networks"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logs should happen when the operation is performed, not when the mono is created. There is the same problem for other log statements in this code, we should fix them all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
Mono<Network> network = getNetwork(context.getNetworkUuid(), context.getOtherNetworkUuids(), resultUuid); | ||
|
||
if (resultUuid != null && cancelComputationRequests.get(resultUuid) != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this "if" happens almost at the same time as the previous one, it's not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
CompletableFuture<SecurityAnalysisResult> future = securityAnalysis.run(VariantManagerConstants.INITIAL_VARIANT_ID, context.getParameters(), n -> tuple.getT2()); | ||
if (resultUuid != null) { | ||
futures.put(resultUuid, future); | ||
} | ||
if (resultUuid != null && cancelComputationRequests.get(resultUuid) != null) { | ||
return Mono.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a log to all the short circuit returns because without it, the log will look like this:
Run security analysis on contingency lists: ...
loading resource network
loading resource ...
cancelling
... tons of network-store-client logs because the operation continues...
...and nothing here to remind us that we didn't run the security analysis
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
and conflicts resolution Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Resolving conflicts Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisService.java # src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisWorkerService.java
Kudos, SonarCloud Quality Gate passed! |
No description provided.