damccorm opened a new pull request, #41791:
URL: https://github.com/apache/beam/pull/41791

   Note: this PR was auto-generated by tooling. Before moving it out of draft, 
the author has done a full review of the PR, specifically evaluating it on the 
following criteria:
   
   - The PR is an appropriate fix for the issue (e.g. we're not changing a test 
to avoid a bug)
   - The PR is a simple fix to the issue (e.g. we're not adding infra when we 
could just modify a test)
   - The PR is not covering for other problems (e.g. if we're bumping timeouts, 
it is not because we're covering for a performance problem)
     
   Full details of the methodology of generation and review can be found here - 
https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
   
   If you have concerns with the PR or with the underlying methodology used to 
generate this, please comment below - they will be addressed by the author not 
the tooling :)
   
   ## Summary
   
   Fixes `Connection reset by peer` when calling `getCollectionSizeInBytes` 
after the ~10-minute 10M-record write pipeline finishes in `PerformanceTests 
MongoDBIO IT` (https://github.com/apache/beam/actions/runs/44958800791).
   
   ## Root Cause
   
   `MongoDBIOIT.setUp()` constructed `mongoClient` with 
`MongoClients.create(mongoUrl)` using the driver's default unlimited 
`maxConnectionIdleTime` (`0`). While `writePipeline` runs 10M records on 
Dataflow (~10m10s), the pooled client socket exceeds the 600s GKE TCP 
LoadBalancer idle timeout and is silently dropped; the subsequent non-retryable 
`collStats` `runCommand` in `getCollectionSizeInBytes()` then fails with 
`Connection reset by peer`.
   
   ## Changes
   
   - 
`sdks/java/io/mongodb/src/test/java/org/apache/beam/sdk/io/mongodb/MongoDBIOIT.java`:
     - Configure `maxConnectionIdleTime(5, TimeUnit.MINUTES)` via 
`MongoClientSettings` so idle pooled sockets are evicted before the 600s LB 
timeout.
     - Wrap `getCollectionSizeInBytes()`'s `collStats` lookup with the existing 
`IOITHelper.executeWithRetry(...)` helper.
   
   ### Verification
   - Triggered `beam_PerformanceTests_MongoDBIO_IT.yml` workflow run on branch: 
[`46462237411`](https://github.com/apache/beam/actions/runs/46462237411)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to