[jira] [Commented] (SOLR-17740) JAX-RS V2 API requests with payloads can skip first byte

2025-04-18 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17945668#comment-17945668
 ] 

ASF subversion and git services commented on SOLR-17740:


Commit f8ae02cc79ea25b5163249c9f4053b74ee02a286 in solr's branch 
refs/heads/branch_9x from David Smiley
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=f8ae02cc79e ]

SOLR-17740: V2 API: fix raw file uploads missing 1st byte (#3322)

SolrRequestParsers can consume one byte of the underlying stream, but V2 was 
ignoring the SolrQueryRequest content stream.  Fix is to detect HTTP body in a 
more standards-compliant way; don't read a byte to see.

(cherry picked from commit 4aa321635d6fd71e9e0812c97639886ebc229735)


> JAX-RS V2 API requests with payloads can skip first byte
> 
>
> Key: SOLR-17740
> URL: https://issues.apache.org/jira/browse/SOLR-17740
> Project: Solr
>  Issue Type: Bug
>  Components: v2 API
>Reporter: David Smiley
>Assignee: David Smiley
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The new V2 API (JAX-RS, Jersey) has its own stack of code between Solr's 
> V2HttpCall and the handler, that which doesn't know about the 
> SolrQueryRequest.  Specifically 
> {{org.apache.solr.api.V2HttpCall#handleAdmin}} doesn't use {{solrReq}} as it 
> passes on to {{{}invokeJerseyRequest{}}}. But the payload of the request has 
> been somewhat parsed already into the ContentStream on SolrQueryRequest, and 
> this can sometimes require reading the first byte – see 
> {{{}org.apache.solr.servlet.SolrRequestParsers.RawRequestParser#parseParamsAndFillStreams{}}}.
>  Consequently V2 requests like FileStore uploadFile can be impacted depending 
> on the details of the headers present.
> In practice, Jetty HttpClient intermittently was triggering affected and 
> unaffected requests when executing the following test:
> {{./gradlew :solr:core:test --tests 
> "org.apache.solr.cli.PackageToolTest.testPackageTool" 
> -Ptests.seed=B8415E6AAC736FCD}}



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

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Commented] (SOLR-17740) JAX-RS V2 API requests with payloads can skip first byte

2025-04-18 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17945667#comment-17945667
 ] 

ASF subversion and git services commented on SOLR-17740:


Commit 4aa321635d6fd71e9e0812c97639886ebc229735 in solr's branch 
refs/heads/main from David Smiley
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=4aa321635d6 ]

SOLR-17740: V2 API: fix raw file uploads missing 1st byte (#3322)

SolrRequestParsers can consume one byte of the underlying stream, but V2 was 
ignoring the SolrQueryRequest content stream.  Fix is to detect HTTP body in a 
more standards-compliant way; don't read a byte to see.

> JAX-RS V2 API requests with payloads can skip first byte
> 
>
> Key: SOLR-17740
> URL: https://issues.apache.org/jira/browse/SOLR-17740
> Project: Solr
>  Issue Type: Bug
>  Components: v2 API
>Reporter: David Smiley
>Assignee: David Smiley
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The new V2 API (JAX-RS, Jersey) has its own stack of code between Solr's 
> V2HttpCall and the handler, that which doesn't know about the 
> SolrQueryRequest.  Specifically 
> {{org.apache.solr.api.V2HttpCall#handleAdmin}} doesn't use {{solrReq}} as it 
> passes on to {{{}invokeJerseyRequest{}}}. But the payload of the request has 
> been somewhat parsed already into the ContentStream on SolrQueryRequest, and 
> this can sometimes require reading the first byte – see 
> {{{}org.apache.solr.servlet.SolrRequestParsers.RawRequestParser#parseParamsAndFillStreams{}}}.
>  Consequently V2 requests like FileStore uploadFile can be impacted depending 
> on the details of the headers present.
> In practice, Jetty HttpClient intermittently was triggering affected and 
> unaffected requests when executing the following test:
> {{./gradlew :solr:core:test --tests 
> "org.apache.solr.cli.PackageToolTest.testPackageTool" 
> -Ptests.seed=B8415E6AAC736FCD}}



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

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Commented] (SOLR-17740) JAX-RS V2 API requests with payloads can skip first byte

2025-04-16 Thread David Smiley (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17945176#comment-17945176
 ] 

David Smiley commented on SOLR-17740:
-

After looking deeper at why PushbackInputStream was added back in SOLR-15418 
(me to fix another bug for v2), I'm happy to report I can remove that, and all 
tests pass now.  In the last 4 years, perhaps some detail changed about v2 
pertaining to why I chose that unfortunate solution then.

> JAX-RS V2 API requests with payloads can skip first byte
> 
>
> Key: SOLR-17740
> URL: https://issues.apache.org/jira/browse/SOLR-17740
> Project: Solr
>  Issue Type: Bug
>  Components: v2 API
>Reporter: David Smiley
>Assignee: David Smiley
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The new V2 API (JAX-RS, Jersey) has its own stack of code between Solr's 
> V2HttpCall and the handler, that which doesn't know about the 
> SolrQueryRequest.  Specifically 
> {{org.apache.solr.api.V2HttpCall#handleAdmin}} doesn't use {{solrReq}} as it 
> passes on to {{{}invokeJerseyRequest{}}}. But the payload of the request has 
> been somewhat parsed already into the ContentStream on SolrQueryRequest, and 
> this can sometimes require reading the first byte – see 
> {{{}org.apache.solr.servlet.SolrRequestParsers.RawRequestParser#parseParamsAndFillStreams{}}}.
>  Consequently V2 requests like FileStore uploadFile can be impacted depending 
> on the details of the headers present.
> In practice, Jetty HttpClient intermittently was triggering affected and 
> unaffected requests when executing the following test:
> {{./gradlew :solr:core:test --tests 
> "org.apache.solr.cli.PackageToolTest.testPackageTool" 
> -Ptests.seed=B8415E6AAC736FCD}}



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

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org