Skip to content
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

feat: use dlq to handle computation errors #148

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<antlr4.version>4.10.1</antlr4.version>
<!-- FIXME: powsybl-ws-commons modules'version is overloaded in the dependencies section
The overloads and this property below have to be removed at next powsybl-ws-dependencies.version upgrade -->
Comment on lines 59 to 60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove also or to keep but use it in the override?

<powsybl-ws-commons.version>1.17.0</powsybl-ws-commons.version>
</properties>

<build>
Expand Down Expand Up @@ -94,6 +93,11 @@
<dependencyManagement>
<dependencies>
<!-- overrides of imports -->
<dependency><!-- To remove when integrate in next release of gridsuite-dependencies or powsybl-ws-dependencies -->
<groupId>com.powsybl</groupId>
<artifactId>powsybl-ws-commons</artifactId>
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
Expand Down Expand Up @@ -139,8 +143,6 @@
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-ws-commons</artifactId>
<!-- FIXME: to be removed at next powsybl-ws-dependencies upgrade -->
<version>${powsybl-ws-commons.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected LoadFlowResultContext fromMessage(Message<String> message) {
}

@Override
protected LoadFlowResult run(LoadFlowRunContext runContext, UUID resultUuid, AtomicReference<ReportNode> rootReporter) throws Exception {
protected LoadFlowResult run(LoadFlowRunContext runContext, UUID resultUuid, AtomicReference<ReportNode> rootReporter) {
LoadFlowResult result = super.run(runContext, resultUuid, rootReporter);
if (result != null && !result.isFailed()) {
// flush network in the network store
Expand Down
18 changes: 13 additions & 5 deletions src/main/resources/config/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ spring:
application:
name: loadflow-server


cloud:
function:
definition: consumeRun;consumeCancel
Expand All @@ -13,6 +12,7 @@ spring:
group: loadflowGroup
consumer:
concurrency: 4
max-attempts: 1
publishRun-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run
publishResult-out-0:
Expand All @@ -23,12 +23,20 @@ spring:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.cancel
publishStopped-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.stopped
publishFailed-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.failed
publishCancelFailed-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.cancelfailed
output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishFailed-out-0;publishCancelFailed-out-0

output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishCancelFailed-out-0
rabbit:
bindings:
consumeRun-in-0:
consumer:
auto-bind-dlq: true
dead-letter-exchange: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run.dlx
dead-letter-queue-name: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run.dlx.dlq
dead-letter-exchange-type: topic
quorum:
enabled: true
delivery-limit: 2
Comment on lines +37 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but in my deployment I needed to remove manually the existing queue (that was a classic queue). What to do on our deployments?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not set default type to quorum, I took the branch of gridsuite/deployment#469

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in dev since we don't persist data, docker compose down and then up is enough to force to recreate the queues. You don't need a special branch in the deployment, explicit quorum queues are already supporter in the rabbitmq version that we use on main (3.13.x)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking "what to do for our dev/rec/production envs?" as I did manual actions on my local deployment

powsybl-ws:
database:
name: loadflow
Expand Down
Loading