diff --git a/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IlpOverHttpLink.java b/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IlpOverHttpLink.java index 4b7b1e06..25d9f774 100644 --- a/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IlpOverHttpLink.java +++ b/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IlpOverHttpLink.java @@ -41,6 +41,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.time.Duration; +import java.time.Instant; import java.util.Objects; import java.util.Optional; import java.util.function.Supplier; @@ -120,6 +122,12 @@ public IlpOverHttpLink( public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket); + if (preparePacket.getExpiresAt() != null && + okHttpClient.readTimeoutMillis() <= Duration.between(Instant.now(), preparePacket.getExpiresAt()).toMillis()) { + logger.warn("OkHttpClient read timeout is shorter than the Prepare Packet's timeout. " + + "This may result in an HTTP timeout while unexpired ILP packets are in flight."); + } + final Request okHttpRequest; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();