You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Therefore, rateLimitDelay in func (h *hydrateCall) start(...) is always 0.
Unless I'm missing something, the fix should be simple:
diff --git a/plugin/hydrate_call.go b/plugin/hydrate_call.go
index 326a90f..37d2df6 100644
--- a/plugin/hydrate_call.go+++ b/plugin/hydrate_call.go@@ -93,7 +94,7 @@ func (h *hydrateCall) canStart(rowData *rowData) bool {
// Start starts a hydrate call
func (h *hydrateCall) start(ctx context.Context, r *rowData, d *QueryData) time.Duration {
- var rateLimitDelay time.Duration+ rateLimitDelay := h.rateLimit(ctx, d)
// tell the rowData to wait for this call to complete
r.wg.Add(1)
I've reproduced the issue with a minimal version of the common List (basic data) / Get (detailed data) pattern described in writing-plugins#about-get-functions with a 1/1 rate limiter:
Thanks for creating steampipe!
When columns are hydrated the (token bucket) rate limits are not applied.
They were applied when rate limiting support was added in #623 (see 29bb9f0#diff-76a6f7859c8b2e295c2242907a10f928f794bd066f88070e31268b72d68bb11eR101).
However, when support for memoized functions to be assigned as column hydrate functions was removed in #756, the call to
h.rateLimit(ctx, d)
was lost (see https://github.com/turbot/steampipe-plugin-sdk/pull/756/files#diff-76a6f7859c8b2e295c2242907a10f928f794bd066f88070e31268b72d68bb11eL102).Therefore,
rateLimitDelay
infunc (h *hydrateCall) start(...)
is always 0.Unless I'm missing something, the fix should be simple:
I've reproduced the issue with a minimal version of the common List (basic data) / Get (detailed data) pattern described in writing-plugins#about-get-functions with a 1/1 rate limiter:
Before patch (unexpected time, 55ms, given
value
is selected):After patch (expected time; ~1s per hydrate call => ~3s total):
plugin.go
table_test_table.go
The text was updated successfully, but these errors were encountered: