Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Sep 26, 2024
1 parent b0b4884 commit 536d46b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,7 @@ public boolean onIdleExpired(TimeoutException timeout)
{
if (_httpChannel.getRequest() == null)
return true;
Runnable task = _httpChannel.onIdleTimeout(timeout);

if (task != null)
ExceptionUtil.mustExecute(getExecutor(), task);
ExceptionUtil.mustExecute(getExecutor(), _httpChannel.onIdleTimeout(timeout));
return false; // We've handle the exception
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1229,10 +1229,11 @@ public boolean handle(Request request, Response response, Callback callback)
assertThat(demand.getCount(), is(1L));

Callback.Completable callback = new Callback.Completable();
// Writes are possible, unless a pending write is failed.

// Writes are not possible
handling.get().write(false, null, callback);
assertTrue(callback.isDone());
assertFalse(callback.isCompletedExceptionally());
assertTrue(callback.isCompletedExceptionally());

// Run the onFailure task.
try (StacklessLogging ignore = new StacklessLogging(Response.class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ else if (s == MAX_SUPPRESSED)
// TODO javadoc
public static void mustExecute(Executor executor, Runnable task)
{
if (task == null)
return;

if (executor instanceof TryExecutor tryExecutor && tryExecutor.tryExecute(task))
return;

Expand Down

0 comments on commit 536d46b

Please sign in to comment.