-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adjust timeouts and improve logging #53
Merged
BenjaminPelletier
merged 1 commit into
interuss:main
from
BenjaminPelletier:uss_qualifier/logging
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
from datetime import timedelta | ||
from typing import Tuple | ||
|
||
import flask | ||
from uas_standards.astm.f3411.v19.constants import Scope | ||
|
||
from . import handling | ||
from .app import webapp | ||
from .config import KEY_QUERY_TIMEOUT | ||
from .oauth import requires_scope | ||
from .requests import RIDObservationGetDisplayDataRequest, RIDObservationGetDetailsRequest | ||
|
||
timeout = timedelta(seconds=webapp.config[KEY_QUERY_TIMEOUT]) | ||
|
||
|
||
@webapp.route('/riddp/observation/display_data', methods=['GET']) | ||
@requires_scope([Scope.Read]) | ||
def rid_observation_display_data() -> Tuple[str, int]: | ||
"""Implements retrieval of current display data per automated testing API.""" | ||
return handling.fulfill_query(RIDObservationGetDisplayDataRequest(view=flask.request.args['view'])) | ||
return handling.fulfill_query(RIDObservationGetDisplayDataRequest(view=flask.request.args['view']), timeout) | ||
|
||
|
||
@webapp.route('/riddp/observation/display_data/<flight_id>', methods=['GET']) | ||
@requires_scope([Scope.Read]) | ||
def rid_observation_flight_details(flight_id: str) -> Tuple[str, int]: | ||
"""Implements get flight details endpoint per automated testing API.""" | ||
return handling.fulfill_query(RIDObservationGetDetailsRequest(id=flight_id)) | ||
return handling.fulfill_query(RIDObservationGetDetailsRequest(id=flight_id), timeout) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those values seem low compared to others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional and hopefully correct :) Both calls to atproxy handler endpoints should have very little overhead -- just accessing shared memory and returning the result. The first one (query) is given a longer timeout (8 seconds) because it intentionally blocks for 5 seconds optimistically hoping that a request might show up on the queue. The fulfillment query (this one) merely writes to shared memory and returns, so therefore should never reasonably take longer than this (I think).
I'm not 100% sure this is correct though because there's obviously something I don't understand because #28 continues to be a problem, especially on my local machine where I can reproduce it pretty much every time.