argoproj / argoproj/argo-workflows
Java SDK does not properly Watch Workflows
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
### Pre-requisites
- [X] I have double-checked my configuration
- [X] I can confirm the issues exists when I tested with `:latest`
- [ ] I'd like to contribute the fix myself (see [contributing guide](https://github.com/argoproj/argo-workflows/blob/master/docs/CONTRIBUTING.md))
### What happened/what you expected to happen?
## Scenario
The `workflowServiceWatchWorkflows` call always ends in an `APIException` due to `io.argoproj.workflow.ApiException: java.net.SocketTimeoutException: timeout`.
Running this with a simple `whalesay` workflow ends in error, even when the workflow takes 20 seconds to finish and the timeout is set to 120.
### Version
v3.4.5
### Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
```YAML
Example here: https://github.com/pmbrull/argo-java-examples/blob/main/playground/src/main/java/SimpleWorkflowWatch.java
```
### Logs from the workflow controller
```text
Workflow finishes correctly
```
### Logs from in your workflow's wait container
```text
Logs from the `workflowServiceWatchWorkflows` call:
io.argoproj.workflow.ApiException: java.net.SocketTimeoutException: timeout
at io.argoproj.workflow.ApiClient.deserialize(ApiClient.java:782)
at io.argoproj.workflow.ApiClient.handleResponse(ApiClient.java:1001)
at io.argoproj.workflow.ApiClient.execute(ApiClient.java:925)
at io.argoproj.workflow.apis.WorkflowServiceApi.workflowServiceWatchWorkflowsWithHttpInfo(WorkflowServiceApi.java:2494)
at io.argoproj.workflow.apis.WorkflowServiceApi.workflowServiceWatchWorkflows(WorkflowServiceApi.java:2464)
at SimpleWorkflowWatch.main(SimpleWorkflowWatch.java:49)
Caused by: java.net.SocketTimeoutException: timeout
at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:147)
at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:158)
at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:337)
at okio.RealBufferedSource.request(RealBufferedSource.kt:206)
at okio.RealBufferedSource.require(RealBufferedSource.kt:199)
at okio.RealBufferedSource.readHexadecimalUnsignedLong(RealBufferedSource.kt:381)
at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.readChunkSize(Http1ExchangeCodec.kt:429)
at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.kt:408)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:276)
at okio.Buffer.writeAll(Buffer.kt:1290)
at okio.RealBufferedSource.readString(RealBufferedSource.kt:95)
at okhttp3.ResponseBody.string(ResponseBody.kt:187)
at io.argoproj.workflow.ApiClient.deserialize(ApiClient.java:778)
... 5 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.base/java.net.SocketInputStream.socketRead0(Native Method)
at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1449)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1060)
at okio.InputStreamSource.read(JvmOkio.kt:94)
at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:125)
... 15 more
```
```
Contributor guide
Research direction
Start by running the SimpleWorkflowWatch.java example linked in the issue and reproduce the workflowServiceWatchWorkflows timeout. Trace the named call through WorkflowServiceApi.java and ApiClient.java, then verify that watching a short workflow completes without the reported SocketTimeoutException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100