Skip to content

Commit ab7dc92

Browse files
Merge branch 'main' into upgrade_to_powsybl_dependencies_2024.4.0
2 parents 522d0ef + 4a2f188 commit ab7dc92

File tree

6 files changed

+54
-27
lines changed

6 files changed

+54
-27
lines changed

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<groupId>org.gridsuite</groupId>
2121
<artifactId>gridsuite-security-analysis-server</artifactId>
22-
<version>2.11.0-SNAPSHOT</version>
22+
<version>2.12.0-SNAPSHOT</version>
2323

2424
<packaging>jar</packaging>
2525
<name>Security analysis server</name>
@@ -86,6 +86,11 @@
8686
<dependencyManagement>
8787
<dependencies>
8888
<!-- overrides of imports -->
89+
<dependency><!-- To remove when integrate in next release of gridsuite-dependencies or powsybl-ws-dependencies -->
90+
<groupId>com.powsybl</groupId>
91+
<artifactId>powsybl-ws-commons</artifactId>
92+
<version>1.19.0</version>
93+
</dependency>
8994
<dependency><!-- To remove when integrate in next release of gridsuite-dependencies or powsybl-ws-dependencies -->
9095
<groupId>com.squareup.okhttp3</groupId>
9196
<artifactId>okhttp-bom</artifactId>

src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisWorkerService.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ public SecurityAnalysisResult run(SecurityAnalysisRunContext runContext) {
105105
runContext.setNetwork(network);
106106
AtomicReference<ReportNode> rootReporter = new AtomicReference<>();
107107
return run(runContext, null, rootReporter);
108-
} catch (InterruptedException e) {
109-
Thread.currentThread().interrupt();
110-
return null;
111108
} catch (Exception e) {
112109
LOGGER.error(getFailedMessage(getComputationType()), e);
113110
return null;

src/main/resources/config/application.yaml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
spring:
22
application:
33
name: security-analysis-server
4-
4+
55
jpa:
66
properties:
77
hibernate:
@@ -20,6 +20,7 @@ spring:
2020
group: saGroup
2121
consumer:
2222
concurrency: 2
23+
max-attempts: 1
2324
publishRun-out-0:
2425
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run
2526
publishResult-out-0:
@@ -30,11 +31,21 @@ spring:
3031
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancel
3132
publishStopped-out-0:
3233
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.stopped
33-
publishFailed-out-0:
34-
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.failed
3534
publishCancelFailed-out-0:
3635
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancelfailed
37-
output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishFailed-out-;publishCancelFailed-out-0
36+
output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishCancelFailed-out-0
37+
rabbit:
38+
bindings:
39+
consumeRun-in-0:
40+
consumer:
41+
auto-bind-dlq: true
42+
dead-letter-exchange: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.dlx
43+
dead-letter-queue-name: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.dlx.dlq
44+
dead-letter-exchange-type: topic
45+
quorum:
46+
enabled: true
47+
delivery-limit: 2
48+
3849

3950
powsybl-ws:
4051
database:
@@ -59,9 +70,6 @@ security-analysis:
5970
highBound: 75
6071
- nominalV: 90
6172
lowBound: 75
62-
highBound: 120
63-
- nominalV: 150
64-
lowBound: 120
6573
highBound: 180
6674
- nominalV: 225
6775
lowBound: 180
@@ -70,23 +78,30 @@ security-analysis:
7078
lowBound: 300
7179
highBound: 500
7280
limitDurations:
73-
- lowBound: 600
74-
lowClosed: false
81+
- lowBound: 1200
82+
lowClosed: true
7583
highBound: ~
7684
highClosed: false
85+
- lowBound: 600
86+
lowClosed: true
87+
highBound: 1200
88+
highClosed: false
7789
- lowBound: 300
7890
lowClosed: true
7991
highBound: 600
80-
highClosed: true
81-
- lowBound: 0
92+
highClosed: false
93+
- lowBound: 60
8294
lowClosed: true
8395
highBound: 300
8496
highClosed: false
97+
- lowBound: 0
98+
lowClosed: true
99+
highBound: 60
100+
highClosed: false
85101
defaultValues:
86-
- [ 1, 1, 1, 1 ]
87-
- [ 1, 1, 1, 1 ]
88-
- [ 1, 1, 1, 1 ]
89-
- [ 1, 1, 1, 1 ]
90-
- [ 1, 1, 1, 1 ]
91-
- [ 1, 1, 1, 1 ]
92-
- [ 1, 1, 1, 1 ]
102+
- [ 1, 1, 1, 1, 1, 1 ]
103+
- [ 1, 1, 1, 1, 1, 1 ]
104+
- [ 1, 1, 1, 1, 1, 1 ]
105+
- [ 1, 1, 1, 1, 1, 1 ]
106+
- [ 1, 1, 0.95, 0.95, 0.9, 0.9 ]
107+
- [ 1, 1, 0.95, 0.95, 0.9, 0.9 ]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
3+
<changeSet author="jamalk (generated)" id="1734002324759-1">
4+
<sql dbms="postgresql">
5+
TRUNCATE TABLE limit_reduction_entity CASCADE;
6+
</sql>
7+
</changeSet>
8+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ databaseChangeLog:
3636
- include:
3737
file: changesets/changelog_20240705T122208Z.xml
3838
relativeToChangelogFile: true
39+
- include:
40+
file: changesets/changelog_20241212T111835Z.xml
41+
relativeToChangelogFile: true
42+

src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisControllerTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import static org.gridsuite.securityanalysis.server.util.TestUtils.assertLogMessage;
7676
import static org.hamcrest.MatcherAssert.assertThat;
7777
import static org.junit.jupiter.api.Assertions.assertEquals;
78+
import static org.junit.jupiter.api.Assertions.assertNull;
7879
import static org.mockito.ArgumentMatchers.any;
7980
import static org.mockito.BDDMockito.given;
8081
import static org.mockito.Mockito.doNothing;
@@ -673,11 +674,8 @@ void runTestWithError() throws Exception {
673674
UUID resultUuid = mapper.readValue(resultAsString, UUID.class);
674675
assertEquals(RESULT_UUID, resultUuid);
675676

676-
// Message stopped has been sent
677-
Message<byte[]> cancelMessage = output.receive(TIMEOUT, "sa.failed");
678-
assertEquals(RESULT_UUID.toString(), cancelMessage.getHeaders().get("resultUuid"));
679-
assertEquals("me", cancelMessage.getHeaders().get("receiver"));
680-
assertEquals(getFailedMessage(COMPUTATION_TYPE) + " : " + ERROR_MESSAGE, cancelMessage.getHeaders().get("message"));
677+
// No result message
678+
assertNull(output.receive(TIMEOUT, "sa.result"));
681679

682680
// No result
683681
assertResultNotFound(RESULT_UUID);

0 commit comments

Comments
 (0)