playframework / playframework/play-ws
Fix AsyncCachingHandler to not block
Open
Nobody has claimed this yet.
status:backlog
- Dominant language
- Scala
- Stars
- 224
- Forks
- 92
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 28
Description
The AsyncCachingHandler is not using the Cache Future and is blocking using Await.result internally.
This can be easily fixed by only calling onCompleted inside the future's completed block.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/cache/AsyncCachingHandler.scala around line 153 and inspect how the Cache Future is handled. Verify that onCompleted is invoked from the future's completed block rather than through blocking Await.result. Done means the handler no longer blocks while waiting for the cache future.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100