Skip to content
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

never ending cycle, while querying #4564

Open
fssrepository opened this issue Nov 19, 2023 · 4 comments
Open

never ending cycle, while querying #4564

fssrepository opened this issue Nov 19, 2023 · 4 comments
Labels
status: feedback-provided Feedback has been provided

Comments

@fssrepository
Copy link

fssrepository commented Nov 19, 2023

  1. it's causing never ending cycle on 3.1.5 - spring boot:

@query("{profile.$id: :profileId}")
Optional findUserByProfile(@param("profileId") UUID profileId);

commenting out the query works:

//@query("{profile.$id: :profileId}")
Optional findUserByProfile(@param("profileId") UUID profileId);

Not sure, why it's behaving in this way, but it shouldn't blow up any server!

It should override the normal behaviour as default, shouldn't be fiddling with the binding, and call itself 1M times, should throw exception!

  1. the follwing syntax also was working before:
[
    {
        "$match": {
            "$elemMatch": {
                "profiles.$id": {
                    "$in": [
                        ":#{#profileIds}"
                    ]
                }
            }
        }
    }
]

Now, it's neither accepting profiles.$id nor does return back anything

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 19, 2023
@christophstrobl
Copy link
Member

@fssrepository first of all, no matter how frustrating errors may be please keep our code of conduct in mind.

Nevertheless, thank you for reporting the issue.

Please address named parameters with :#{#...} and enclose keys in quotes, especially when using field names with special characters. Something like { 'profile.$id' : :#{#profileId} }.

You mentioned the $match expression was working before. Please provide more details (upgrading from which version,...) and take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

@christophstrobl christophstrobl 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 Nov 20, 2023
@fssrepository
Copy link
Author

fssrepository commented Nov 20, 2023

2.3.0-Release to 3.1.5. In older version it was working.

I have noticed that the RestRepository is also far more restrictive, and i can't just override default behaviours in the controller or add new ones to the exact url, because it's simply ignoring it without any exception which is also a bad thing. The other bottleneck was the /**/ pattern was not allowed anymore.

I think the never ending cycle is similar to my RestRepository problem, as spring moved toward a more restrictive less error-prone approach.

I also converted the project from kotlin to java (groove/kotlin gradle) and extended the @Aggregatiom to load up from json files. I have pretty long queries to ease the pain on pagination, and make the client more lightweight.

As it was a pretty basic problem, it's quite easy to reproduce. That query i have loaded from json file in an aggregation pipeline, but i have also printed out the query in the log.

That quotes are a little bit different, as it's saved and loaded as a valid json file, not like added to an @Aggregation as a string.

@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 Nov 20, 2023
@christophstrobl
Copy link
Member

Thanks for the additional information, sounds like there's quite a bit of customization. Does the query work for you with the changes proposed?
I did not yet have the time to look into the @Aggregation but will try to get to it soon.

@fssrepository
Copy link
Author

fssrepository commented Nov 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided
Projects
None yet
Development

No branches or pull requests

3 participants