fix(topograph): the 'topology' endpoint to return '102 Processing' when the request has't completed yet#192
Conversation
…en the request has't completed yet Signed-off-by: Dmitry Shmulevich <dshmulevich@nvidia.com>
Contributor
Greptile OverviewGreptile SummaryChanged the
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant HTTPServer
participant TrailingDelayQueue
participant Handler
Note over Client,Handler: Initial Request
Client->>HTTPServer: POST /v1/generate (topology request)
HTTPServer->>TrailingDelayQueue: Submit(item)
TrailingDelayQueue->>TrailingDelayQueue: Store item, generate UID
TrailingDelayQueue-->>HTTPServer: Return UID
HTTPServer-->>Client: 202 Accepted (UID)
Note over Client,Handler: Polling for Results (Before This PR)
Client->>HTTPServer: GET /v1/topology?uid=xxx
HTTPServer->>TrailingDelayQueue: Get(uid)
alt Request still processing
TrailingDelayQueue-->>HTTPServer: Status: 202 Accepted
HTTPServer-->>Client: 202 Accepted (unclear state)
else Request not found
TrailingDelayQueue-->>HTTPServer: Status: 404 Not Found
HTTPServer-->>Client: 404 Not Found
end
Note over Client,Handler: Polling for Results (After This PR)
Client->>HTTPServer: GET /v1/topology?uid=xxx
HTTPServer->>TrailingDelayQueue: Get(uid)
alt Request still processing (current UID)
TrailingDelayQueue-->>HTTPServer: Status: 102 Processing
HTTPServer-->>Client: 102 Processing (request not completed yet)
else Request not found (invalid UID)
TrailingDelayQueue-->>HTTPServer: Status: 404 Not Found
HTTPServer-->>Client: 404 Not Found (request ID not found)
else Request completed successfully
TrailingDelayQueue->>Handler: Execute handler
Handler-->>TrailingDelayQueue: Result
TrailingDelayQueue-->>HTTPServer: Status: 200 OK + Result
HTTPServer-->>Client: 200 OK + Topology Data
end
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.