gnodet-bot commented on code in PR #30980:
URL: https://github.com/apache/camel/pull/30980#discussion_r4720583925
##########
components/camel-elasticsearch/src/main/java/org/apache/camel/component/es/ElasticsearchScrollRequestIterator.java:
##########
@@ -42,6 +47,7 @@ public class ElasticsearchScrollRequestIterator<TDocument>
implements Iterator<H
private String scrollId;
private boolean closed;
private int requestCount;
+ private Closeable resource;
Review Comment:
`resource` is written by `closeOnClose()` from the producer thread (inside
`process()`) and read by `close()` / `closeAtEnd()` from the iterator consumer
thread. Without `volatile`, there is no happens-before guarantee — the reader
thread could see `null` and silently skip closing the client.
```suggestion
private volatile Closeable resource;
```
--
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]