-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Core: Upgrade Jetty to 12.1.5 #15232
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -325,7 +325,8 @@ public <T extends RESTResponse> T handleRequest( | |
|
|
||
| String eTag = ETagProvider.of(response.metadataLocation()); | ||
|
|
||
| if (ifNoneMatchHeader.isPresent() && eTag.equals(ifNoneMatchHeader.get().value())) { | ||
| if (ifNoneMatchHeader.isPresent() | ||
| && eTag.equals(stripETagSuffix(ifNoneMatchHeader.get().value()))) { | ||
| return null; | ||
| } | ||
|
|
||
|
|
@@ -738,4 +739,18 @@ private static SnapshotMode snapshotModeFromQueryParams(Map<String, String> quer | |
| .getOrDefault("snapshots", RESTCatalogProperties.SNAPSHOT_LOADING_MODE_DEFAULT) | ||
| .toUpperCase(Locale.US)); | ||
| } | ||
|
|
||
| /** | ||
| * Strips the compression suffix from an ETag value. | ||
| * | ||
| * <p>Jetty 12 appends "--gzip" to ETags when compression is enabled. This method removes such | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was that causing test failures or why is this needed exactly?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an explanation here jetty/jetty.project#13047 (comment)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the pointer. Was this causing test failures? I don't see etags with --gzip when running with the changes from #10837, so I wonder whether you ran into issues here? I'm wondering whether that started to happen after switching to the new Compression API
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I believe that's due to new compression API. |
||
| * suffixes to allow proper ETag comparison. | ||
| */ | ||
| static String stripETagSuffix(String eTag) { | ||
| if (eTag == null) { | ||
| return null; | ||
| } | ||
| int suffixIndex = eTag.indexOf("--"); | ||
| return suffixIndex > 0 ? eTag.substring(0, suffixIndex) : eTag; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.iceberg.spark; | ||
|
|
||
| import com.codahale.metrics.MetricRegistry; | ||
| import java.util.Properties; | ||
| import org.apache.spark.SparkConf; | ||
| import org.apache.spark.metrics.sink.MetricsServlet; | ||
| import org.sparkproject.jetty.servlet.ServletContextHandler; | ||
|
|
||
| /** | ||
| * A dummy implementation of {@link MetricsServlet} that does not start a server or report metrics. | ||
| * This is used in tests to avoid conflicts with Spark's jetty dependencies. | ||
| */ | ||
| public class DummyMetricsServlet extends MetricsServlet { | ||
|
|
||
| /** | ||
| * Constructor required by Spark's reflection-based instantiation. | ||
| * | ||
| * @param properties Metrics properties | ||
| * @param registry Metric registry | ||
| */ | ||
| public DummyMetricsServlet(Properties properties, MetricRegistry registry) { | ||
| super(properties, registry); | ||
| } | ||
|
|
||
| @Override | ||
| public ServletContextHandler[] getHandlers(SparkConf conf) { | ||
| return new ServletContextHandler[] {}; | ||
| } | ||
|
manuzhang marked this conversation as resolved.
|
||
|
|
||
| @Override | ||
| public void start() { | ||
| // No-op for tests | ||
| } | ||
|
|
||
| @Override | ||
| public void stop() { | ||
| // No-op for tests | ||
| } | ||
|
|
||
| @Override | ||
| public void report() { | ||
| // No-op for tests | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.