aws / aws/serverless-java-container

Use Futures instead of latches to synchronize request processing

Open
#276 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
1.6k
Forks
574
PR merge metrics
No merged PRs in 30d

Description

* Framework version: 2.0
* Implementations: All

## Scenario
The framework currently uses latches on the `HttpServletResponse` implementation to wait for the completion of a request. We should change this to use Futures. This need for this was highlighted in #272 as throwing an exception without releasing the latch may cause memory leaks.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the HttpServletResponse implementation and the latch lifecycle used during request processing, then review issue #272 for the exception path that can leave the latch unreleased. Done means request completion uses Futures instead of latches across all implementations without retaining resources when an exception occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.