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

RateLimitException hit for all write/upload operations #804

Closed
andy-esch opened this issue Jun 19, 2019 · 6 comments
Closed

RateLimitException hit for all write/upload operations #804

andy-esch opened this issue Jun 19, 2019 · 6 comments
Assignees
Labels

Comments

@andy-esch
Copy link
Contributor

andy-esch commented Jun 19, 2019

cf version: 1.0b1
python version: 3.7.3

I'm not able to write (with cartocontext.write) or upload (with dataset.upload) to my carto account with v1.0b1. I keep getting RateLimitException

Looking into it, I'm not sure why this would be happening 🤷‍♂

@alrocar any idea?

from cartoframes.auth import set_default_context, Context
from cartoframes.data import Dataset


cc = Context(
    base_url='https://eschbacher.carto.com/',
    api_key='abc123'
)

set_default_context(
    context=cc
)

df = pd.DataFrame({
        'lat': range(10),
        'lng': range(10, 0, -1),
        'attr': list('abcdefghij')
    })

## This will raise a RateLimitException
## Behavior is the same for new table and overwriting existing tables
cc.write(
    df,
    'test4',
    overwrite=True
)

## This will raise a RateLimitException too
Dataset.from_dataframe(df).upload(table_name='isthisthingon')
@andy-esch andy-esch added this to the Release v1.0b2 milestone Jun 19, 2019
@andy-esch andy-esch added the bug label Jun 19, 2019
@andy-esch
Copy link
Contributor Author

Well now it works extremely well as if nothing is wrong. Maybe related to #780 ?

@alrocar
Copy link
Contributor

alrocar commented Jun 20, 2019

If I'm not wrong RateLimitException is thrown mainly when a timeout occurs in the database. And CartoRateLimitException is only thrown when there's a legit case of a rate limit hit.

If it was a case of RateLimitException it could mean there was some lock in the database. Let's summon @CartoDB/rt-managers to prioritize now that @oleurud is helping there and could investigate what happened. IMO this is more related to our APIs than to CARTOframes itself.

In any case, from the CARTOframes side, we'll have to be more verbose for this kind of exceptions, otherwise will get eventually a bunch of recurrent support cases.

@Jesus89 Jesus89 modified the milestones: Release v1.0b2, [1.0] Refactor Auth/Data API Jun 24, 2019
@simon-contreras-deel simon-contreras-deel self-assigned this Jun 25, 2019
@simon-contreras-deel
Copy link
Contributor

simon-contreras-deel commented Jun 25, 2019

After testing it with both accounts (yours and mine), I have not been able to reproduce it.

About timeout: now we are using Batch or Copy, and they have a timeout of 12 hours and 5 hours respectively. So, I suppose that is not the case.

About rate limits: it could be possible because we have a limit of 1 copy every ~10 seconds, but the error should be CartoRateLimitException, could it be? It could be for example, if you are doing requests and someone is using your credentials (from an example) at the same time.

Have you suffered it again after that?

@simon-contreras-deel
Copy link
Contributor

Checking it in Kibana, I see 7 responses with a 429 error from your account and all of them are query timeouts. It is rare because the timeout is raising after 25 seconds (the default db timeout) instead of 5 hours.

Further work needed to know the problem importance

@simon-contreras-deel
Copy link
Contributor

simon-contreras-deel commented Jun 25, 2019

In the last 7 days, we have only your 7 requests from a total of 3.370.

For now, I would forget this one, but I will keep an eye on the dashboard the following days.

I am going to close it, but feel free to reopen if you see something wrong or it is happening again

@andy-esch
Copy link
Contributor Author

Thanks for looking into this @oleurud. Yeah, another one of those strange transient ones. I'll ping back if I see anything again.

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

No branches or pull requests

4 participants