Skip to content

Commit 3b7c908

Browse files
committed
chore: add error log on stream fail, retry cancels
Signed-off-by: Todd Baert <[email protected]>
1 parent ac8a4db commit 3b7c908

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdProviderSyncResources.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public void waitForInitialization(long deadline) {
6161
// if wait(0) is called, the thread would wait forever, so we abort when this would happen
6262
if (now >= end) {
6363
throw new GeneralError(String.format(
64-
"Deadline exceeded. Condition did not complete within the %d ms deadline", deadline));
64+
"Startup timeout exceeded. Initialization did not complete within the %d ms deadline",
65+
deadline));
6566
}
6667
long remaining = end - now;
6768
synchronized (this) {

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/ChannelBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ public class ChannelBuilder {
5858
"retryableStatusCodes",
5959
Arrays.asList(
6060
/*
61-
* All codes are retryable except OK, CANCELLED and DEADLINE_EXCEEDED since
61+
* All codes are retryable except OK and DEADLINE_EXCEEDED since
6262
* any others not listed here cause a very tight loop of retries.
63-
* CANCELLED is not retryable because it is a client-side termination.
6463
* DEADLINE_EXCEEDED is typically a result of a client specified deadline,
6564
* and definitionally should not result in a tight loop (it's a timeout).
6665
*/
66+
Code.CANCELLED.toString(),
6767
Code.UNKNOWN.toString(),
6868
Code.INVALID_ARGUMENT.toString(),
6969
Code.NOT_FOUND.toString(),

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/connector/sync/SyncStreamQueueSource.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ private void observeSyncStream() throws InterruptedException {
157157

158158
Throwable streamException = taken.getError();
159159
if (streamException != null) {
160-
log.debug("Exception in GRPC connection, streamException {}, will reconnect", streamException);
161-
if (!outgoingQueue.offer(new QueuePayload(
162-
QueuePayloadType.ERROR, "Error from stream or metadata", metadataResponse))) {
160+
log.error("Exception in GRPC connection, streamException {}, will reconnect", streamException);
161+
if (!outgoingQueue.offer(
162+
new QueuePayload(QueuePayloadType.ERROR, "Error from stream: ", metadataResponse))) {
163163
log.error("Failed to convey ERROR status, queue is full");
164164
}
165165
break;

0 commit comments

Comments
 (0)