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

subscriptions only yield on change #384

Closed
oliver-sanders opened this issue Sep 2, 2022 · 5 comments · Fixed by cylc/cylc-flow#5225
Closed

subscriptions only yield on change #384

oliver-sanders opened this issue Sep 2, 2022 · 5 comments · Fixed by cylc/cylc-flow#5225
Assignees
Labels
bug Something isn't working question Flag this as a question for the next Cylc project meeting.
Milestone

Comments

@oliver-sanders
Copy link
Member

Spotted by @MetRonnie 👀

Subscriptions in GraphiQL only come through when the data is updated.

This was the cause behind #328 (which was never really solved).

E.G. Here I run a subscription, but get no results until I install or remove a workflow.

graphiql

Note: In order to reproduce you must have no running workflows.

Note: Changing the initialBurst argument makes no difference.

I think this is a bug, yet strangely if I open the UI, my stopped workflows appear in the workflows list so maybe it's just GraphiQL.

Is this how it's meant to work?

Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read CONTRIBUTING.md before starting any work though).

@oliver-sanders oliver-sanders added bug Something isn't working question Flag this as a question for the next Cylc project meeting. labels Sep 2, 2022
@oliver-sanders oliver-sanders added this to the pending milestone Sep 2, 2022
@hjoliver
Copy link
Member

hjoliver commented Sep 6, 2022

Any ideas on this one @dwsutherland ?

@dwsutherland
Copy link
Member

I'm able to reproduce this.. Will look into it, pretty sure it use to work.

I think this is a bug, yet strangely if I open the UI, my stopped workflows appear in the workflows list so maybe it's just GraphiQL.

Perhaps because it starts before the first scan is complete (?), so it gets that change

@dwsutherland dwsutherland self-assigned this Oct 20, 2022
@dwsutherland
Copy link
Member

The deltas entry point does work:

subscription {
  deltas (stripNull: true) {
    id
    updated {
      workflow {
        id
        status
        stateTotals
      }
    }
    added {
      workflow{
        id
        status
        stateTotals
      }
    }
  }
}

Hence why the UI works .. so it's probably the workflows and others

@dwsutherland
Copy link
Member

dwsutherland commented Nov 14, 2022

Found it.. it's the ignoreInterval .. this works:

subscription {
  workflows (initialBurst: true, ignoreInterval: 0.0) {
    id
    states
    stateTotals
  }
}

Defaults to 2.5 seconds .. reason being; these entry points dump the entire store (not just the deltas), although they can be made to do deltas (via args)...
If zero it would push the whole store on any delta by default..

I'll make a change so the first always gets through no matter the interval..

@dwsutherland
Copy link
Member

fix up.. it's a one liner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Flag this as a question for the next Cylc project meeting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants