-
Notifications
You must be signed in to change notification settings - Fork 175
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
alignStepBoundaries edge cases #98
Comments
Thomas, totally agree on these things. Thanks for the feedback! Were you hoping to contribute these things? My plan is to use much of the upcoming holiday to work through Trickster issues, so if you are unable, we should be able to get them ripped out soon in any event. |
I can definitely submit a PR for these. If you are okay with all 3 changes I'll get a PR going with those changes. |
Absolutely. thank you! |
If end is past `now` we'll simply truncate to `now` for simplicity, otherwise we end up caching data we can't possibly have. With this change we also pick up the case where both start/end are past `now` Fixes trickstercache#98
This way if any query is sent without a step param we simply return an error (as it is a required query param). Fixes trickstercache#98
PR created: #99 |
Hi Thomas, looks like this change has created a defect wherein the initial request for data (e.g., a trickster cache miss) results in an empty set to the user, while subsequent (cache hits) are successful. Are you able to take a look and identify what went wrong? I will keep digging to see if it's something I did wrong in my tests. |
So you are saying that you get different results for cache miss vs cache hit? I definitely didn't see that before, so that is interesting. Do you have a repro case? |
@jranson I did some quick local testing and can't reproduce the error (I can send a query and I get the same result when its a hit or a miss). If you have a repro case (or test case) I can definitely take a look into it. |
Definitely seeing an issue, might be related to #96 instead of #98. Here is how I detected it (using the current master merged with your recent changes): Start trickster with a 100% clean cache. Request any url
(empty response) Make the same request again:
Full Response Received:
|
(accompanying debug logs for the requests above)
|
As a more concrete example, I curl'd |
Thomas - it looks like your example that is working is a query, rather than a query_range. The issue appears to be isolated to query_range requests. I am still digging but it looks related to checks around response StatusCode handling (it is being seen as 0 instead of 200, and thus triggering the errorBody instead of the "good" body at or around handlers.go:724) Try it with Also, an additional regression has been introduced with your PR that I have found: providing the same value for |
@jacksontj Everything checks out now. This is truly awesome, thank you so much for all of these contributions. Trickster is so much better because of it! |
This method is not very large, but does a few things which IMO are questionable.
reversing start/end
if the user flipped start/end, it is not the responsibility of trickster to flip it. This is additionally confusing as things will work, but if trickster is removed from the call path all queries this fixes will break. IMO it is not the place of the cache to "correct" user queries.
time.Now()
checksI think its fine to cut off queries from going into the future, but this doesn't handle the case where both start/end are in the future. IMO in that case this should return an error. In the remaining cases I think its fine to leave it truncating
end
as the query results will remain unaffected, although I'd rather it didn't (thetime.Now()
constraint is a cache issue, not a query issue).default
step paramIf the user didn't define one, this is not the place of a caching proxy to correct it. Here we should just return an error and make the user correct their query.
The text was updated successfully, but these errors were encountered: