Skip to content

Conversation

@gus-asf
Copy link
Contributor

@gus-asf gus-asf commented Dec 24, 2025

@gus-asf gus-asf requested a review from dsmiley December 24, 2025 02:43
Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change needed in JettySolrRunner?
If tests pass then cool.

Matcher matcher = p.matcher(requestPath);
if (matcher.lookingAt()) {
if (chain != null) {
chain.doFilter(request, response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow that was a sneaky side-effect of what looked like a simple boolean method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup took me a moment to figure out why my first pass attempt was somehow still passing control to SolrDispatchFilter (which becomes next in line)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah actually looking there, there is a change that probably should be made, since patterns are being set (but now ignored).

// servlets that are more focused in scope. This should become possible now that we have a
// ServletContextListener for startup/shutdown of CoreContainer that sets up a service from which
// things like CoreContainer can be requested. (or better yet injected)
public class SolrDispatchFilter extends HttpFilter implements PathExcluder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you can also remove PathExcluder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and pull methods out of ServletUtils too! this is fun :-)

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought -- perhaps this class should extend Jetty's org.eclipse.jetty.ee10.servlets.IncludeExcludeBasedFilter
On the other hand, maybe there isn't much value in doing so.

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PathExclusionFilter extends HttpFilter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have a bit of documentaton on what it does. Like "if the path matches the configured criteria, we process with the 'default' servlet, that which serves files."

@gus-asf
Copy link
Contributor Author

gus-asf commented Dec 24, 2025

Just a thought -- perhaps this class should extend Jetty's org.eclipse.jetty.ee10.servlets.IncludeExcludeBasedFilter On the other hand, maybe there isn't much value in doing so.

Interesting thought, but looking at that class, I think it's too much of a "Swiss army knife", and employing it will likely add complexity and add extra logic to be executed on each request.

@gus-asf
Copy link
Contributor Author

gus-asf commented Dec 24, 2025

No change needed in JettySolrRunner? If tests pass then cool.

I think this is because tests don't use static resources. We'll hit this eventually. JettySolrRunner's best/worst feature/failing is that it doesn't load a full web application. Which avoids classpath scanning making it much faster, but also makes it unrealistic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants