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

Reject archives with null source/destination #95

Open
candlerb opened this issue Sep 6, 2019 · 1 comment
Open

Reject archives with null source/destination #95

candlerb opened this issue Sep 6, 2019 · 1 comment
Assignees

Comments

@candlerb
Copy link

candlerb commented Sep 6, 2019

Relates to perfsonar/pscheduler#909

In unusual circumstances where pscheduler submits metadata with "source": null and "measurement-agent": null, an invalid archive is created with "event-types": [], but esmond still returns a 201 response as if everything was OK. Also, subsequent data posts to this archive return 201 responses, but don't store any data. This means that user-visible pscheduler logs say that everything is working fine.

I think both cases should give 4xx responses. To reproduce:

$ cat test.json
{
  "time-duration": 29.0,
  "pscheduler-reference-psconfig-created-by-user-agent": "psconfig-pscheduler-agent",
  "pscheduler-test-type": "throughput",
  "source": null,
  "measurement-agent": null,
  "input-destination": "2001:db8:123:456::45",
  "destination": "2001:db8:123:456::45",
  "event-types": [
    {
      "event-type": "failures"
    },
    {
      "summaries": [
        {
          "summary-type": "average",
          "summary-window": 86400,
          "event-type": "throughput"
        }
      ],
      "event-type": "throughput"
    },
    {
      "event-type": "throughput-subintervals"
    },
    {
      "event-type": "packet-retransmits"
    },
    {
      "event-type": "packet-retransmits-subintervals"
    },
    {
      "event-type": "pscheduler-run-href"
    }
  ],
  "subject-type": "point-to-point",
  "ip-transport-protocol": "tcp",
  "input-source": "ns1.example.com",
  "pscheduler-reference-psconfig-created-by-uuid": "b042dea5-40fd-4c63-9b0b-1e0f63bf59a6",
  "tool-name": "pscheduler/iperf3"
}

$ curl -sk -H "Content-Type: application/json" -H "Authorization: Token xxxx" \
    -X POST -d @test.json https://localhost/esmond/perfsonar/archive/
{"url":"https://localhost/esmond/perfsonar/archive/ff6a9054a2b344c59196c26fb3c0d662/"
"metadata-key":"ff6a9054a2b344c59196c26fb3c0d662",
"subject-type":"point-to-point",
"event-types":[],
"uri":"/esmond/perfsonar/archive/ff6a9054a2b344c59196c26fb3c0d662/"}

Notice the empty event-types member.

@laeti-tia
Copy link
Member

I've experienced this behaviour too when looking at perfsonar/pscheduler#958 which has measurement-agent: None being sent to Esmond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants