Open johnkm516 opened 5 months ago
I believe this is a UI issue. When the trigger is small, the trigger lock button in many cases does not appear beside the trigger toggle. The user can toggle the trigger off in the UI, but the change does not save properly.
@MilosPaunovic here is a reproducer with no external service (I'm using docker-compose here, so maybe you want to change the postgres information connection in the trigger)
id: triggertest
namespace: dev
labels:
env: dev
tasks:
- id: wait
type: io.kestra.plugin.scripts.shell.Commands
commands:
- sleep 10
- id: print_status
type: io.kestra.plugin.core.log.Log
message: hello
triggers:
- id: query
type: io.kestra.plugin.jdbc.postgresql.Trigger
fetch: true
fetchSize: 30
interval: PT3S
password: k3str4
sql: "select *from pg_namespace"
stopAfter:
- FAILED
- WARNING
url: jdbc:postgresql://postgres:5432/kestra
username: kestra
As @johnkm516 mentioned, when the flow is triggered, if you switch the trigger toggle off, new executions are still triggered
This seems like it is not handled as expected on the BE side. I use the flow Ben provided:
id: triggertest
namespace: github
labels:
env: dev
tasks:
- id: wait
type: io.kestra.plugin.scripts.shell.Commands
commands:
- sleep 10
- id: print_status
type: io.kestra.plugin.core.log.Log
message: hello
triggers:
- id: query
type: io.kestra.plugin.jdbc.postgresql.Trigger
fetch: true
fetchSize: 30
interval: PT3S
password: k3str4
sql: "select * from pg_namespace"
stopAfter:
- FAILED
- WARNING
url: jdbc:postgresql://localhost:5432/kestra_unit
username: kestra
And on triggers tab request is sent to disable it, in response there is disabled: true
property, but it seems like it is ignored for some reason, as when I switch tabs back to Executions
, new ones are being triggered, and when I get back to Triggers
, it shows it as enabled
.
I can not reproduce on 0.18.7, with PostgresSQL @MilosPaunovic what was your backend when testing ?
@Skraye PostgresSQL
running on Docker
and regular Java
app running from IntelliJ
.
@Ben8t @johnkm516 Are you still able to reproduce it ?
@Skraye the reproducer I've provided doesn't trigger anything anymore 🤔 (0.19.1) Got this from trigger logs
btw, this task return results:
- id: query
type: io.kestra.plugin.jdbc.postgresql.Query
password: k3str4
sql: "select *from pg_namespace"
url: jdbc:postgresql://postgres:5432/kestra
username: kestra
store: true
Don't see any issue open related to this, do you think something wrong's going on here ?
Describe the issue
My flow is an SQL Server trigger which queries the DB for certain rows. The trigger is set to 3 seconds, as the flow won't trigger if there are no rows in the output of the select query.
If the flow is continuously being triggered at an interval of 3 seconds, and I use the Kestra UI to disable the trigger (toggle off), it does not save properly. Despite me toggling off the trigger multiple times.
Per my tests, this happens if a triggered flow is still currently running. If a triggered flow is still running, the Kestra UI refuses to disable the trigger. You have to wait until all flows with the trigger finishes, which is impossible if the trigger is continuously triggering new flows. To fix it, I have to edit the flow to make the trigger interval > the time it would take to complete all the flows that has been triggered, wait until the flows are complete, then toggle off the trigger.
Minimal reproducible example :
Environment