Skip to content

Commit

Permalink
Add configuration to set timeout for AsyncContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Haoning-Sun committed Dec 4, 2023
1 parent 041510a commit 9098d51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/common/src/main/java/alluxio/conf/PropertyKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -5498,6 +5498,13 @@ public String toString() {
.setConsistencyCheckLevel(ConsistencyCheckLevel.ENFORCE)
.setScope(Scope.SERVER)
.build();
public static final PropertyKey PROXY_S3_V2_ASYNC_CONTEXT_TIMEOUT_MS =
durationBuilder(Name.PROXY_S3_V2_ASYNC_CONTEXT_TIMEOUT_MS)
.setDefaultValue("1min")
.setDescription("The timeout for async context.")
.setConsistencyCheckLevel(ConsistencyCheckLevel.ENFORCE)
.setScope(Scope.SERVER)
.build();
public static final PropertyKey PROXY_STREAM_CACHE_TIMEOUT_MS =
durationBuilder(Name.PROXY_STREAM_CACHE_TIMEOUT_MS)
.setAlias("alluxio.proxy.stream.cache.timeout.ms")
Expand Down Expand Up @@ -8787,6 +8794,8 @@ public static final class Name {
"alluxio.proxy.s3.v2.async.heavy.pool.maximum.thread.number";
public static final String PROXY_S3_V2_ASYNC_HEAVY_POOL_QUEUE_SIZE =
"alluxio.proxy.s3.v2.async.heavy.pool.queue.size";
public static final String PROXY_S3_V2_ASYNC_CONTEXT_TIMEOUT_MS =
"alluxio.proxy.s3.v2.async.context.timeout";
public static final String S3_UPLOADS_ID_XATTR_KEY = "s3_uploads_mulitpartupload_id";
public static final String PROXY_S3_BUCKETPATHCACHE_TIMEOUT_MS =
"alluxio.proxy.s3.bucketpathcache.timeout";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public void service(HttpServletRequest request,
: getServletContext().getAttribute(PROXY_S3_V2_HEAVY_POOL));

final AsyncContext asyncCtx = request.startAsync();
asyncCtx.setTimeout(Configuration
.getMs(PropertyKey.PROXY_S3_V2_ASYNC_CONTEXT_TIMEOUT_MS));
final S3Handler s3HandlerAsync = s3Handler;
es.submit(() -> {
try {
Expand Down

0 comments on commit 9098d51

Please sign in to comment.