Skip to content

Commit 27f56e9

Browse files
authored
Merge branch 'apache:trunk' into trunk
2 parents 684b38e + 8f83d9f commit 27f56e9

File tree

119 files changed

+99814
-520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+99814
-520
lines changed

LICENSE-binary

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,36 @@ io.grpc:grpc-protobuf:1.26.0
261261
io.grpc:grpc-protobuf-lite:1.26.0
262262
io.grpc:grpc-stub:1.26.0
263263
io.netty:netty:3.10.6.Final
264-
io.netty:netty-all:4.1.42.Final
265-
io.netty:netty-buffer:4.1.27.Final
266-
io.netty:netty-codec:4.1.27.Final
267-
io.netty:netty-codec-http:4.1.27.Final
268-
io.netty:netty-codec-http2:4.1.27.Final
269-
io.netty:netty-codec-socks:4.1.27.Final
270-
io.netty:netty-common:4.1.27.Final
271-
io.netty:netty-handler:4.1.27.Final
272-
io.netty:netty-handler-proxy:4.1.27.Final
273-
io.netty:netty-resolver:4.1.27.Final
274-
io.netty:netty-transport:4.1.27.Final
264+
io.netty:netty-all:4.1.77.Final
265+
io.netty:netty-buffer:4.1.77.Final
266+
io.netty:netty-codec:4.1.77.Final
267+
io.netty:netty-codec-dns:4.1.77.Final
268+
io.netty:netty-codec-haproxy:4.1.77.Final
269+
io.netty:netty-codec-http:4.1.77.Final
270+
io.netty:netty-codec-http2:4.1.77.Final
271+
io.netty:netty-codec-memcache:4.1.77.Final
272+
io.netty:netty-codec-mqtt:4.1.77.Final
273+
io.netty:netty-codec-redis:4.1.77.Final
274+
io.netty:netty-codec-smtp:4.1.77.Final
275+
io.netty:netty-codec-socks:4.1.77.Final
276+
io.netty:netty-codec-stomp:4.1.77.Final
277+
io.netty:netty-codec-xml:4.1.77.Final
278+
io.netty:netty-common:4.1.77.Final
279+
io.netty:netty-handler:4.1.77.Final
280+
io.netty:netty-handler-proxy:4.1.77.Final
281+
io.netty:netty-resolver:4.1.77.Final
282+
io.netty:netty-resolver-dns:4.1.77.Final
283+
io.netty:netty-transport:4.1.77.Final
284+
io.netty:netty-transport-rxtx:4.1.77.Final
285+
io.netty:netty-transport-sctp:4.1.77.Final
286+
io.netty:netty-transport-udt:4.1.77.Final
287+
io.netty:netty-transport-classes-epoll:4.1.77.Final
288+
io.netty:netty-transport-native-unix-common:4.1.77.Final
289+
io.netty:netty-transport-classes-kqueue:4.1.77.Final
290+
io.netty:netty-resolver-dns-classes-macos:4.1.77.Final
291+
io.netty:netty-transport-native-epoll:4.1.77.Final
292+
io.netty:netty-transport-native-kqueue:4.1.77.Final
293+
io.netty:netty-resolver-dns-native-macos:4.1.77.Final
275294
io.opencensus:opencensus-api:0.12.3
276295
io.opencensus:opencensus-contrib-grpc-metrics:0.12.3
277296
io.reactivex:rxjava:1.3.8
@@ -325,20 +344,20 @@ org.apache.solr:solr-solrj:8.8.2
325344
org.apache.yetus:audience-annotations:0.5.0
326345
org.apache.zookeeper:zookeeper:3.6.3
327346
org.codehaus.jettison:jettison:1.1
328-
org.eclipse.jetty:jetty-annotations:9.4.44.v20210927
329-
org.eclipse.jetty:jetty-http:9.4.44.v20210927
330-
org.eclipse.jetty:jetty-io:9.4.44.v20210927
331-
org.eclipse.jetty:jetty-jndi:9.4.44.v20210927
332-
org.eclipse.jetty:jetty-plus:9.4.44.v20210927
333-
org.eclipse.jetty:jetty-security:9.4.44.v20210927
334-
org.eclipse.jetty:jetty-server:9.4.44.v20210927
335-
org.eclipse.jetty:jetty-servlet:9.4.44.v20210927
336-
org.eclipse.jetty:jetty-util:9.4.44.v20210927
337-
org.eclipse.jetty:jetty-util-ajax:9.4.44.v20210927
338-
org.eclipse.jetty:jetty-webapp:9.4.44.v20210927
339-
org.eclipse.jetty:jetty-xml:9.4.44.v20210927
340-
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.44.v20210927
341-
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.44.v20210927
347+
org.eclipse.jetty:jetty-annotations:9.4.48.v20220622
348+
org.eclipse.jetty:jetty-http:9.4.48.v20220622
349+
org.eclipse.jetty:jetty-io:9.4.48.v20220622
350+
org.eclipse.jetty:jetty-jndi:9.4.48.v20220622
351+
org.eclipse.jetty:jetty-plus:9.4.48.v20220622
352+
org.eclipse.jetty:jetty-security:9.4.48.v20220622
353+
org.eclipse.jetty:jetty-server:9.4.48.v20220622
354+
org.eclipse.jetty:jetty-servlet:9.4.48.v20220622
355+
org.eclipse.jetty:jetty-util:9.4.48.v20220622
356+
org.eclipse.jetty:jetty-util-ajax:9.4.48.v20220622
357+
org.eclipse.jetty:jetty-webapp:9.4.48.v20220622
358+
org.eclipse.jetty:jetty-xml:9.4.48.v20220622
359+
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.48.v20220622
360+
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.48.v20220622
342361
org.ehcache:ehcache:3.3.1
343362
org.lz4:lz4-java:1.7.1
344363
org.objenesis:objenesis:2.6

hadoop-common-project/hadoop-common/dev-support/jdiff/Apache_Hadoop_Common_3.2.4.xml

Lines changed: 35426 additions & 0 deletions
Large diffs are not rendered by default.

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
import org.eclipse.jetty.server.Server;
9898
import org.eclipse.jetty.server.ServerConnector;
9999
import org.eclipse.jetty.server.SslConnectionFactory;
100-
import org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker;
100+
import org.eclipse.jetty.server.SymlinkAllowedResourceAliasChecker;
101101
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
102102
import org.eclipse.jetty.server.handler.HandlerCollection;
103103
import org.eclipse.jetty.server.handler.RequestLogHandler;
@@ -939,7 +939,7 @@ protected void addDefaultApps(ContextHandlerCollection parent,
939939
handler.setHttpOnly(true);
940940
handler.getSessionCookieConfig().setSecure(true);
941941
logContext.setSessionHandler(handler);
942-
logContext.addAliasCheck(new AllowSymLinkAliasChecker());
942+
logContext.addAliasCheck(new SymlinkAllowedResourceAliasChecker(logContext));
943943
setContextAttributes(logContext, conf);
944944
addNoCacheFilter(logContext);
945945
defaultContexts.put(logContext, true);
@@ -958,7 +958,7 @@ protected void addDefaultApps(ContextHandlerCollection parent,
958958
handler.setHttpOnly(true);
959959
handler.getSessionCookieConfig().setSecure(true);
960960
staticContext.setSessionHandler(handler);
961-
staticContext.addAliasCheck(new AllowSymLinkAliasChecker());
961+
staticContext.addAliasCheck(new SymlinkAllowedResourceAliasChecker(staticContext));
962962
setContextAttributes(staticContext, conf);
963963
defaultContexts.put(staticContext, true);
964964
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public class RetryInvocationHandler<T> implements RpcInvocationHandler {
4646
public static final Logger LOG = LoggerFactory.getLogger(
4747
RetryInvocationHandler.class);
4848

49+
@VisibleForTesting
50+
public static final ThreadLocal<Boolean> SET_CALL_ID_FOR_TEST =
51+
ThreadLocal.withInitial(() -> true);
52+
4953
static class Call {
5054
private final Method method;
5155
private final Object[] args;
@@ -159,7 +163,7 @@ CallReturn invoke() throws Throwable {
159163
}
160164

161165
Object invokeMethod() throws Throwable {
162-
if (isRpc) {
166+
if (isRpc && SET_CALL_ID_FOR_TEST.get()) {
163167
Client.setCallIdAndRetryCount(callId, counters.retries,
164168
retryInvocationHandler.asyncCallHandler);
165169
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public final class CallerContext {
4747
// field names
4848
public static final String CLIENT_IP_STR = "clientIp";
4949
public static final String CLIENT_PORT_STR = "clientPort";
50+
public static final String CLIENT_ID_STR = "clientId";
51+
public static final String CLIENT_CALL_ID_STR = "clientCallId";
5052

5153
/** The caller context.
5254
*

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RetryCache.java

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ public static class CacheEntry implements LightWeightCache.Entry {
5555
/**
5656
* Processing state of the requests.
5757
*/
58-
private static byte INPROGRESS = 0;
59-
private static byte SUCCESS = 1;
60-
private static byte FAILED = 2;
58+
private static final byte INPROGRESS = 0;
59+
private static final byte SUCCESS = 1;
60+
private static final byte FAILED = 2;
6161

6262
private byte state = INPROGRESS;
6363

6464
// Store uuid as two long for better memory utilization
65-
private final long clientIdMsb; // Most signficant bytes
65+
private final long clientIdMsb; // Most significant bytes
6666
private final long clientIdLsb; // Least significant bytes
6767

6868
private final int callId;
@@ -140,8 +140,8 @@ public long getExpirationTime() {
140140

141141
@Override
142142
public String toString() {
143-
return (new UUID(this.clientIdMsb, this.clientIdLsb)).toString() + ":"
144-
+ this.callId + ":" + this.state;
143+
return String.format("%s:%s:%s", new UUID(this.clientIdMsb, this.clientIdLsb),
144+
this.callId, this.state);
145145
}
146146
}
147147

@@ -183,7 +183,7 @@ public Object getPayload() {
183183

184184
private final LightWeightGSet<CacheEntry, CacheEntry> set;
185185
private final long expirationTime;
186-
private String cacheName;
186+
private final String cacheName;
187187

188188
private final ReentrantLock lock = new ReentrantLock();
189189

@@ -195,19 +195,19 @@ public Object getPayload() {
195195
*/
196196
public RetryCache(String cacheName, double percentage, long expirationTime) {
197197
int capacity = LightWeightGSet.computeCapacity(percentage, cacheName);
198-
capacity = capacity > MAX_CAPACITY ? capacity : MAX_CAPACITY;
198+
capacity = Math.max(capacity, MAX_CAPACITY);
199199
this.set = new LightWeightCache<CacheEntry, CacheEntry>(capacity, capacity,
200200
expirationTime, 0);
201201
this.expirationTime = expirationTime;
202202
this.cacheName = cacheName;
203203
this.retryCacheMetrics = RetryCacheMetrics.create(this);
204204
}
205205

206-
private static boolean skipRetryCache() {
206+
private static boolean skipRetryCache(byte[] clientId, int callId) {
207207
// Do not track non RPC invocation or RPC requests with
208208
// invalid callId or clientId in retry cache
209-
return !Server.isRpcInvocation() || Server.getCallId() < 0
210-
|| Arrays.equals(Server.getClientId(), RpcConstants.DUMMY_CLIENT_ID);
209+
return !Server.isRpcInvocation() || callId < 0
210+
|| Arrays.equals(clientId, RpcConstants.DUMMY_CLIENT_ID);
211211
}
212212

213213
public void lock() {
@@ -332,43 +332,51 @@ public void addCacheEntryWithPayload(byte[] clientId, int callId,
332332
retryCacheMetrics.incrCacheUpdated();
333333
}
334334

335-
private static CacheEntry newEntry(long expirationTime) {
336-
return new CacheEntry(Server.getClientId(), Server.getCallId(),
335+
private static CacheEntry newEntry(long expirationTime,
336+
byte[] clientId, int callId) {
337+
return new CacheEntry(clientId, callId,
337338
System.nanoTime() + expirationTime);
338339
}
339340

340341
private static CacheEntryWithPayload newEntry(Object payload,
341-
long expirationTime) {
342-
return new CacheEntryWithPayload(Server.getClientId(), Server.getCallId(),
342+
long expirationTime, byte[] clientId, int callId) {
343+
return new CacheEntryWithPayload(clientId, callId,
343344
payload, System.nanoTime() + expirationTime);
344345
}
345346

346347
/**
347348
* Static method that provides null check for retryCache.
348349
* @param cache input Cache.
350+
* @param clientId client id of this request
351+
* @param callId client call id of this request
349352
* @return CacheEntry.
350353
*/
351-
public static CacheEntry waitForCompletion(RetryCache cache) {
352-
if (skipRetryCache()) {
354+
public static CacheEntry waitForCompletion(RetryCache cache,
355+
byte[] clientId, int callId) {
356+
if (skipRetryCache(clientId, callId)) {
353357
return null;
354358
}
355359
return cache != null ? cache
356-
.waitForCompletion(newEntry(cache.expirationTime)) : null;
360+
.waitForCompletion(newEntry(cache.expirationTime,
361+
clientId, callId)) : null;
357362
}
358363

359364
/**
360365
* Static method that provides null check for retryCache.
361366
* @param cache input cache.
362367
* @param payload input payload.
368+
* @param clientId client id of this request
369+
* @param callId client call id of this request
363370
* @return CacheEntryWithPayload.
364371
*/
365372
public static CacheEntryWithPayload waitForCompletion(RetryCache cache,
366-
Object payload) {
367-
if (skipRetryCache()) {
373+
Object payload, byte[] clientId, int callId) {
374+
if (skipRetryCache(clientId, callId)) {
368375
return null;
369376
}
370377
return (CacheEntryWithPayload) (cache != null ? cache
371-
.waitForCompletion(newEntry(payload, cache.expirationTime)) : null);
378+
.waitForCompletion(newEntry(payload, cache.expirationTime,
379+
clientId, callId)) : null);
372380
}
373381

374382
public static void setState(CacheEntry e, boolean success) {

0 commit comments

Comments
 (0)