in reply to Throttling while using LWP for MS Graph request?

Does LWP handle throttling on its own?

No, it has no hidden, automated throttling. That would break the principle of least surprise.

The school I work for

Schools (and similar institutions) often have draconian and perplexing network policies. Don't trust them not to mess with your traffic.

According to MS documentation on this I should receive a return code of 429 on being throttled.

In your shoes I would not trust MS any more than the school.

Your code looks OK on first glance, if not entirely idiomatic. What I would recommend is taking all the bits which are not specific to the endpoint, copy them out to a different script/application and run them against a solid, reliable 3rd-party API from a client which is not within the school network (eg. from your own office or even from a cloud server). That should convince you one way or the other than your generalised API client itself is solid.

Assuming that your client passes the above tests you can then simply allow for the fact that either the school or the MS service (or both) is causing the issue. You could debug this if you have great patience, or you could just handle those occurrences where the responses are not what you expect by binning them and re-requesting them. Having had to deal with both schools and MS in the past I would opt for the latter.

Best of luck.


🦛

  • Comment on Re: Throttling while using LWP for MS Graph request?

Replies are listed 'Best First'.
Re^2: Throttling while using LWP for MS Graph request?
by PeterKaagman (Beadle) on May 14, 2024 at 10:28 UTC

    Ha ha ha... Draconian meausures! Good thing that I'm fully aware of what we're doing being the network administrator ;). We do tend to close things up for sure.

    I do trust our own network, that being said I don't really have a choice but to use the schoolnetwork. The other side of the data is a SIS system which I can only reach from within the schoolnetwork. MS on the other hand.... I do not trust. Taking your advice seriously. Re-requesting suspicious results does sound like a good option.