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

outputs: Transitory message tag appearance #1145

Closed
wxtim opened this issue Nov 23, 2022 · 6 comments
Closed

outputs: Transitory message tag appearance #1145

wxtim opened this issue Nov 23, 2022 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wxtim
Copy link
Member

wxtim commented Nov 23, 2022

Describe the bug
When triggering a second task with a cylc message outputs the output shows up only briefly in the tree view until/unless page refreshed:

Peek 2022-11-23 11-57

Release version(s) and/or repository branch(es) affected?
Found when checking that #1108 fixed #838.

Steps to reproduce the bug
Using workflow

[scheduler]
    allow implicit tasks = True

[scheduling]
    initial cycle point = 1000
    final cycle point = 1003
    [[graph]]
        P1Y = foo => bar

[runtime]
    [[foo]]
        script = """
            echo $CYLC_TASK_SUBMIT_NUMBER
            if [[ $CYLC_TASK_SUBMIT_NUMBER -eq 1 ]]; then
                cylc message -- loscil
                false
            elif [[ $CYLC_TASK_SUBMIT_NUMBER -eq 2 ]]; then
                cylc message -- biosphere
                false
            else
                cylc message -- gas
            fi
        """

run workflow. Re trigger task foo.

Expected behavior

Screenshots

Additional context

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).

@wxtim wxtim added the bug Something isn't working label Nov 23, 2022
@oliver-sanders oliver-sanders self-assigned this Nov 23, 2022
@oliver-sanders oliver-sanders added this to the 1.4.0 milestone Nov 23, 2022
@oliver-sanders
Copy link
Member

Have managed to reproduce.

The root cause of this issue is the way we handle lists in deltas.

  1. Some fields such as childTasks send the entire field for each update.
  2. Other fields such as messages send only the newly-added items.

The ui data store assumes (1) since otherwise it would not be possible for items to be removed from childTasks, only added.

@oliver-sanders
Copy link
Member

Evidence extracted from the deltas...

First we get the messages biosphere and started:

{
	"jobs": [
		{
			"id": "~osanders/ambient//10020101T0000Z/foo/02",
			"startedTime": "2022-11-23T14:41:59Z",
			"state": "running",
			"messages": [
				"biosphere",
				"started"
			],
			"taskProxy": { ... },
			"__typename": "Job"
		}
	]
}

Then later we just get the message failed/ERR, the earlier messages having been removed:

{
	"jobs": [
		{
			"id": "~osanders/ambient//10020101T0000Z/foo/02",
			"finishedTime": "2022-11-23T14:42:01Z",
			"state": "failed",
			"messages": [
				"failed/ERR"
			],
			"taskProxy": { ... },
			"__typename": "Job"
		}
	]
}

@oliver-sanders
Copy link
Member

We could "append" new messages rather than overwriting the entire list, however, this would require maintaining a list of fields for which the merging rules differ at the UI end.

@dwsutherland
Copy link
Member

dwsutherland commented Nov 25, 2022

PR up:
cylc/cylc-flow#5240

have tested it in graphiql, seems to work.

@dwsutherland
Copy link
Member

dwsutherland commented Nov 25, 2022

From Element:

Actually childTasks on FamilyProxy isn't the whole thing either (in the delta), however, an argument default for that subfield is deltaStore: false:

    child_tasks = graphene.List(
        TaskProxy,
        description="""Descendant task proxies.""",
        args=PROXY_ARGS,
        strip_null=STRIP_NULL_DEFAULT,
        delta_store=DELTA_STORE_DEFAULT,
        delta_type=DELTA_TYPE_DEFAULT,
        resolver=get_nodes_by_ids)

so the field resolver pulls from the data-store not the delta-store...

So subfield lists with ID lookups can be configured (in the query args) to do either behavior.

@oliver-sanders
Copy link
Member

Closed by cylc/cylc-flow#5240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants