Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rdf4j-dev] potential iterator leak in repository handling?

I realize you can check but 1) this is in the rdf4j code base so shouldn't it be cleaning up? and 2) if you're querying for triples, presumably they live in storage (or even remote), shouldn't it always be closeable (eg why do we treat model triple results differently?)

On Wednesday, April 5, 2023 at 04:58:00 AM EDT, Håvard Ottestad <hmottestad@xxxxxxxxx> wrote:


You can check if it implements the interface. 

Other than that the general rule of thumb is that if something is backed by disk or network then it should probably be closed in order to release system resources. Another case is where there is a dependency of some sorts, such as a lock that needs to be released. 

Håvard

On 5 Apr 2023, at 10:45, Matthew Nguyen <nguyenm9@xxxxxxx> wrote:


Should they be? If you are querying for triples, how or why do we differentiate whether the returned iterator is AutoCoseable or not?

On Wednesday, April 5, 2023 at 01:48:33 AM EDT, Håvard Ottestad <hmottestad@xxxxxxxxx> wrote:


I don’t think that iterators on models are AutoCloseable. 

Håvard

On 4 Apr 2023, at 22:36, Matthew Nguyen via rdf4j-dev <rdf4j-dev@xxxxxxxxxxx> wrote:


Hey folks,

Think there may be an iterator leak around repository handling.  Statements are pulled and filtered but not seeing how the returned iterator is ever closed.  Relevant code:

https://github.com/eclipse/rdf4j/blob/main/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/RepositoryConfig.java#L155 
https://github.com/eclipse/rdf4j/blob/main/core/model/src/main/java/org/eclipse/rdf4j/model/util/Models.java#L97

Can someone more knowledgeable about this code comment?

thx, matt


_______________________________________________
rdf4j-dev mailing list
rdf4j-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/rdf4j-dev

Back to the top