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
In general, we call setToken() and then an endpoint, like:
public async getKubeVersions() {
setToken(linodeToken);
return await getKubernetesVersions();
}
The issue is we call the endpoints very often with a lot of different linode tokens. Behind @linode/api-v4 is a single axios instance, we keep chang it's header for different requests using setToken() and this may cause a race condition. For example, if two getKubeVersions() call at the same time, we may have:
setToken(tokenA);
setToken(tokenB);
getKubernetesVersions(); // mean to use tokenA but actually used tokenB
getKubernetesVersions();
Do we have a way to avoid this? For example, to create our own axois instance and call the endpoints from there?
Thanks.
The text was updated successfully, but these errors were encountered:
I have made a npm patch to the lib so it creates a new axios for each new request...please kindly let me know when we have an update to support multiple linode token concurrently. Thank you.
Hi team,
In general, we call
setToken()
and then an endpoint, like:The issue is we call the endpoints very often with a lot of different linode tokens. Behind
@linode/api-v4
is a single axios instance, we keep chang it's header for different requests usingsetToken()
and this may cause a race condition. For example, if twogetKubeVersions()
call at the same time, we may have:Do we have a way to avoid this? For example, to create our own axois instance and call the endpoints from there?
Thanks.
The text was updated successfully, but these errors were encountered: