You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2026/07/10 12:28:00 UTC

[jira] [Resolved] (COLLECTIONS-894) TreeBag documentation should explicitly warn about infinite loop as a result of concurrent writes

     [ https://issues.apache.org/jira/browse/COLLECTIONS-894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved COLLECTIONS-894.
-----------------------------------------
    Fix Version/s: 4.6.0
       Resolution: Fixed

PR merged to git master, please verify and close.

> TreeBag documentation should explicitly warn about infinite loop as a result of concurrent writes
> -------------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-894
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-894
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Bag
>            Reporter: Sol Thiessen
>            Priority: Major
>              Labels: doc
>             Fix For: 4.6.0
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> Due to the underlying TreeMap implementation, concurrent writes to TreeBag can result in a malformed tree structure with a cycle. This can cause threads to spin infinitely while putting or getting an entry from a TreeBag. While it is possible to discover that the TreeBag implementation is not thread safe by researching the TreeMap implementation, we would still like to request that the TreeBag documentation say so explicitly. 
> For more info regarding the potential for cycle creation, this blog post was helpful: https://ivoanjo.me/blog/2018/07/21/writing-to-a-java-treemap-concurrently-can-lead-to-an-infinite-loop-during-reads/



--
This message was sent by Atlassian Jira
(v8.20.10#820010)