question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus Redis client timeout shorter than a second

See original GitHub issue

Describe the bug The docs says Redis client timeout is defined as a Duration: https://quarkus.io/guides/redis#quarkus-redis-client_quarkus.redis.timeout

A Duration object is later passed to an underlying implementation, as can be seen here: https://github.com/quarkusio/quarkus/blob/6dce42371c631b3070a953dbe57cfd94f33dc5a1/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/client/runtime/RedisClientImpl.java#L1026

but, internally, only seconds precision is used: https://github.com/quarkusio/quarkus/blob/6dce42371c631b3070a953dbe57cfd94f33dc5a1/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/client/runtime/RedisClientImpl.java#L15

, with the timeout parameter representing the seconds.

So, without fractional seconds precision, we lost the ability to have timeouts shorter than a second.

Expected behavior Instead of silently discarding fractional seconds part, which later leads to a misleading error when client is used:

java.lang.IllegalArgumentException: `duration` must be greater than zero

, it would be nice to allow timeouts shorter than a second, by storing the Duration internally and later passing it as is to Mutiny Redis Client.

The alternative is to throw a more precise exception, saying for instance that timeouts shorter than a second, even though they’re allowed by the Duration, are not allowed.

To Reproduce Define a timeout shorter than a second and try using a RedisClient. E.g.:

quarkus.redis.timeout=PT0.1S

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
geoandcommented, Feb 22, 2021

@abutic I’ll close it.

Just as an FYI for next time, if you add Fixes: #NNNNN like I have done in the description of your PR, GH will automatically link the PR to the issue 😃

1reaction
abuticcommented, Feb 22, 2021

@gsmet and @machi1990, should I close this issue, now that it’s fixed by #15211? Also, should the PR be linked to this issue (I don’t seem to have the permission to link them)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis Extension Reference Guide - Quarkus
This API lets you execute Redis commands more conveniently and safely. 5.1. Injecting data sources. For each configured Redis client, two Redis data...
Read more >
All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >
Using the Redis Client - Quarkus
This guide demonstrates how your Quarkus application can connect to a Redis server using the Redis Client extension. This technology is considered preview....
Read more >
Application Data Caching - Quarkus
For more information about how to install the Quarkus CLI and use it, ... After six long seconds, the application will answer something...
Read more >
Introducing the new Redis API - How to cache with Redis?
The entry point of the new Quarkus Redis API are the two data sources ... these APIs are implemented on top of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found