Skip to content

RetryHandler#retryRequest might fail with IllegalArgumentException: timeout value is negativeΒ #2038

@bpandit-everlaw

Description

@bpandit-everlaw

When using the Microsoft Graph API which then calls com.microsoft.kiota.http.middleware.RetryHandler.retryRequest (see stack trace below), it seems to trigger retryRequest with a negative retryInterval value. It seems that getRetryAfter is returning a negative value at https://github.com/microsoft/kiota-java/blob/main/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/RetryHandler.java#L112.

Please see stack trace:

java.lang.IllegalArgumentException: timeout value is negative
        at java.lang.Thread.sleep(Thread.java:500)
        at com.microsoft.kiota.http.middleware.RetryHandler.retryRequest(RetryHandler.java:115)
        at com.microsoft.kiota.http.middleware.RetryHandler.intercept(RetryHandler.java:252)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.kiota.http.middleware.RedirectHandler.intercept(RedirectHandler.java:158)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.kiota.http.middleware.HeadersInspectionHandler.intercept(HeadersInspectionHandler.java:70)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.kiota.http.middleware.UrlReplaceHandler.intercept(UrlReplaceHandler.java:52)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.kiota.http.middleware.ParametersNameDecodingHandler.intercept(ParametersNameDecodingHandler.java:79)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.kiota.http.middleware.UserAgentHandler.intercept(UserAgentHandler.java:84)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.graph.core.requests.middleware.GraphTelemetryHandler.intercept(GraphTelemetryHandler.java:64)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at com.microsoft.kiota.http.middleware.UrlReplaceHandler.intercept(UrlReplaceHandler.java:72)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at com.microsoft.kiota.http.OkHttpRequestAdapter.getHttpResponseMessage(OkHttpRequestAdapter.java:749)
        at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:302)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done βœ”οΈ

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions