Skip to content

LiteralReplacement-Cache is not threadsafe. #2375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ajanoni opened this issue Sep 8, 2021 · 3 comments
Closed

LiteralReplacement-Cache is not threadsafe. #2375

ajanoni opened this issue Sep 8, 2021 · 3 comments
Assignees
Labels
type: bug A general bug

Comments

@ajanoni
Copy link

ajanoni commented Sep 8, 2021

It is a random error that occurs in different queries in our application:

Here is the stack trace:

2021-09-08 08:53:41 at org.springframework.data.neo4j.repository.query.Neo4jSpelSupport.orderBy(Neo4jSpelSupport.java:71)
   
   
   
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 8, 2021
@meistermeier
Copy link
Collaborator

Could you please provide any further information?

  • Query you used. I assume that this is a @Query annotated repository method.
  • Spring Data Neo4j version
  • If applicable custom versions of the Java driver and similar.

The best would be to get a small reproducer for the problem you are facing.

@meistermeier meistermeier added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 8, 2021
@ajanoni
Copy link
Author

ajanoni commented Sep 8, 2021

The error does occur in other queries that have the orderBy clause, but you can check one example bellow:

Query:

import org.springframework.data.domain.Pageable
import org.springframework.data.domain.Slice
import org.springframework.data.neo4j.repository.Neo4jRepository
import org.springframework.data.neo4j.repository.query.Query

interface AcmeGroupsRepository : Neo4jRepository<AcmeGroupEntity, String> {
    companion object {
        const val BASE_QUERY =
            """
        MATCH (acmeGroup:AcmeGroup)
        WHERE 
          ($${"ids"} IS NULL OR acmeGroup.id IN $${"ids"}) AND  
          ($${"labels"} IS NULL OR acmeGroup.label IN $${"labels"})
        """
    }

    @Query(
        """
        $BASE_QUERY
        RETURN acmeGroup :#{orderBy(#pageable)} SKIP $${"skip"} LIMIT $${"limit"}
    """
    )
    fun findAllByFilters(ids: List<String>?, labels: List<String>?, page: Pageable): Slice<AcmeGroupEntity>

Version: org.springframework.data:spring-data-neo4j:6.1.4

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 8, 2021
@michael-simons michael-simons self-assigned this Sep 9, 2021
@michael-simons michael-simons changed the title Random ConcurrentModificationException (Neo4jSpelSupport) LiteralReplacement-Cache is not threadsafe. Sep 9, 2021
michael-simons added a commit that referenced this issue Sep 9, 2021
@michael-simons michael-simons added type: bug A general bug and removed status: feedback-provided Feedback has been provided labels Sep 9, 2021
@michael-simons michael-simons added this to the 6.0.13 (2020.0.13) milestone Sep 9, 2021
@michael-simons
Copy link
Collaborator

Thanks for reporting this @ajanoni The fix will appear in all branches. Snapshots will be ready soon. If you have the chance to try them, I would appreciate feedback on the fix. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants