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

InfluxDB 2.0: The limit for specify the number of runs to return doesn't works [area/api] #13575

Closed
bednar opened this issue Apr 23, 2019 · 2 comments · Fixed by #14569
Closed

Comments

@bednar
Copy link
Contributor

bednar commented Apr 23, 2019

The /tasks/{taskID}/runs is defined as:

'/tasks/{taskID}/runs':
    get:
      tags:
        - Tasks
      summary: Retrieve list of run records for a task
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: ID of task to get runs for
        - in: query
          name: after
          schema:
            type: string
          description: returns runs after specified ID
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: the number of runs to return
        - in: query
          name: afterTime
          schema:
            type: string
            format: date-time
          description: filter runs to those scheduled after this time, RFC3339
        - in: query
          name: beforeTime
          schema:
            type: string
            format: date-time
          description: filter runs to those scheduled before this time, RFC3339
      responses:
        '200':
          description: a list of task runs
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Runs"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

but even If I specify the limit to limit=1 the result contains more than one Run:

-> GET 
-> http://127.0.0.1:9999/api/v2/tasks/03be4f7125bf2000/runs?limit=1

<- 200
<- OK
<- {
	"links": {
		"self": "/api/v2/tasks/03be4f7125bf2000/runs",
		"task": "/api/v2/tasks/03be4f7125bf2000"
	},
	"runs": [{
		"links": {
			"logs": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f71517f2000/logs",
			"retry": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f71517f2000/retry",
			"self": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f71517f2000",
			"task": "/api/v2/tasks/03be4f7125bf2000"
		},
		"id": "03be4f71517f2000",
		"taskID": "03be4f7125bf2000",
		"status": "success",
		"scheduledFor": "2019-04-23T08:11:57Z",
		"startedAt": "2019-04-23T08:11:57.144093186Z",
		"finishedAt": "2019-04-23T08:11:57.229171622Z",
		"log": [{
			"time": "2019-04-23T08:11:57.134512051Z",
			"message": "Started task from script: \"option task = {name: \\\"it task1556007116892-IT\\\", every: 1s} \\n from(bucket:\\\"my-bucket\\\") |\u003e range(start: 0) |\u003e last()\""
		}, {
			"time": "2019-04-23T08:11:57.180940759Z",
			"message": "{\"total_duration\":23455447,\"compile_duration\":2525,\"queue_duration\":340500,\"plan_duration\":0,\"requeue_duration\":0,\"execute_duration\":23087473,\"concurrency\":0,\"max_allocated\":0,\"metadata\":{\"influxdb/scanned-bytes\":[0],\"influxdb/scanned-values\":[0]}}"
		}, {
			"time": "2019-04-23T08:11:57.199532857Z",
			"message": "Completed successfully"
		}]
	}, {
		"links": {
			"logs": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f7243ff2000/logs",
			"retry": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f7243ff2000/retry",
			"self": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f7243ff2000",
			"task": "/api/v2/tasks/03be4f7125bf2000"
		},
		"id": "03be4f7243ff2000",
		"taskID": "03be4f7125bf2000",
		"status": "success",
		"scheduledFor": "2019-04-23T08:11:58Z",
		"startedAt": "2019-04-23T08:11:58.106503769Z",
		"finishedAt": "2019-04-23T08:11:58.132624402Z",
		"log": [{
			"time": "2019-04-23T08:11:58.103338134Z",
			"message": "Started task from script: \"option task = {name: \\\"it task1556007116892-IT\\\", every: 1s} \\n from(bucket:\\\"my-bucket\\\") |\u003e range(start: 0) |\u003e last()\""
		}, {
			"time": "2019-04-23T08:11:58.121434936Z",
			"message": "{\"total_duration\":13393224,\"compile_duration\":2555,\"queue_duration\":92507,\"plan_duration\":0,\"requeue_duration\":0,\"execute_duration\":13277520,\"concurrency\":0,\"max_allocated\":0,\"metadata\":{\"influxdb/scanned-bytes\":[0],\"influxdb/scanned-values\":[0]}}"
		}, {
			"time": "2019-04-23T08:11:58.126981744Z",
			"message": "Completed successfully"
		}]
	}, {
		"links": {
			"logs": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f733e7f2000/logs",
			"retry": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f733e7f2000/retry",
			"self": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f733e7f2000",
			"task": "/api/v2/tasks/03be4f7125bf2000"
		},
		"id": "03be4f733e7f2000",
		"taskID": "03be4f7125bf2000",
		"status": "success",
		"scheduledFor": "2019-04-23T08:11:59Z",
		"startedAt": "2019-04-23T08:11:59.108351415Z",
		"finishedAt": "2019-04-23T08:11:59.170085895Z",
		"log": [{
			"time": "2019-04-23T08:11:59.104990453Z",
			"message": "Started task from script: \"option task = {name: \\\"it task1556007116892-IT\\\", every: 1s} \\n from(bucket:\\\"my-bucket\\\") |\u003e range(start: 0) |\u003e last()\""
		}, {
			"time": "2019-04-23T08:11:59.140093048Z",
			"message": "{\"total_duration\":29980370,\"compile_duration\":2974,\"queue_duration\":164064,\"plan_duration\":0,\"requeue_duration\":0,\"execute_duration\":29790164,\"concurrency\":0,\"max_allocated\":0,\"metadata\":{\"influxdb/scanned-bytes\":[0],\"influxdb/scanned-values\":[0]}}"
		}, {
			"time": "2019-04-23T08:11:59.157004895Z",
			"message": "Completed successfully"
		}]
	}, {
		"links": {
			"logs": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f745f7f2000/logs",
			"retry": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f745f7f2000/retry",
			"self": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f745f7f2000",
			"task": "/api/v2/tasks/03be4f7125bf2000"
		},
		"id": "03be4f745f7f2000",
		"taskID": "03be4f7125bf2000",
		"status": "success",
		"scheduledFor": "2019-04-23T08:12:00Z",
		"startedAt": "2019-04-23T08:12:00.26926201Z",
		"finishedAt": "2019-04-23T08:12:00.31867907Z",
		"log": [{
			"time": "2019-04-23T08:12:00.255204162Z",
			"message": "Started task from script: \"option task = {name: \\\"it task1556007116892-IT\\\", every: 1s} \\n from(bucket:\\\"my-bucket\\\") |\u003e range(start: 0) |\u003e last()\""
		}, {
			"time": "2019-04-23T08:12:00.302138229Z",
			"message": "{\"total_duration\":9181467,\"compile_duration\":2459,\"queue_duration\":23795,\"plan_duration\":0,\"requeue_duration\":0,\"execute_duration\":9132846,\"concurrency\":0,\"max_allocated\":0,\"metadata\":{\"influxdb/scanned-bytes\":[0],\"influxdb/scanned-values\":[0]}}"
		}, {
			"time": "2019-04-23T08:12:00.314015779Z",
			"message": "Completed successfully"
		}]
	}, {
		"links": {
			"logs": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f7547ff2000/logs",
			"retry": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f7547ff2000/retry",
			"self": "/api/v2/tasks/03be4f7125bf2000/runs/03be4f7547ff2000",
			"task": "/api/v2/tasks/03be4f7125bf2000"
		},
		"id": "03be4f7547ff2000",
		"taskID": "03be4f7125bf2000",
		"status": "success",
		"scheduledFor": "2019-04-23T08:12:01Z",
		"startedAt": "2019-04-23T08:12:01.210750294Z",
		"finishedAt": "2019-04-23T08:12:01.260819165Z",
		"log": [{
			"time": "2019-04-23T08:12:01.18518034Z",
			"message": "Started task from script: \"option task = {name: \\\"it task1556007116892-IT\\\", every: 1s} \\n from(bucket:\\\"my-bucket\\\") |\u003e range(start: 0) |\u003e last()\""
		}, {
			"time": "2019-04-23T08:12:01.24488142Z",
			"message": "{\"total_duration\":13453321,\"compile_duration\":2425,\"queue_duration\":77163,\"plan_duration\":0,\"requeue_duration\":0,\"execute_duration\":13356190,\"concurrency\":0,\"max_allocated\":0,\"metadata\":{\"influxdb/scanned-bytes\":[0],\"influxdb/scanned-values\":[0]}}"
		}, {
			"time": "2019-04-23T08:12:01.255762479Z",
			"message": "Completed successfully"
		}]
	}]
}
@stale
Copy link

stale bot commented Jul 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 22, 2019
@russorat
Copy link
Contributor

+1

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

Successfully merging a pull request may close this issue.

4 participants