Skip to content

STAB-838: mention temporal in connection error messages #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ library:
- aeson
- async
- lens-family
- monad-logger
- network-bsd
- proto-lens
- unliftio
Expand All @@ -57,4 +58,3 @@ library:
when:
- condition: os(darwin)
frameworks: [Security, CoreFoundation, SystemConfiguration]

1 change: 0 additions & 1 deletion core/rust/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ pub fn connect_client(
runtime,
}),
Err(e) => {
eprintln!("Error: {:?}", e);
let err_message = e.to_string().into_bytes();
Err(CArray::c_repr_of(err_message).unwrap())
}
Expand Down
7 changes: 5 additions & 2 deletions core/src/Temporal/Core/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module Temporal.Core.Client (
import Control.Concurrent
import Control.Exception
import Control.Monad
import Control.Monad.Logger
import Data.Aeson
import Data.Aeson.TH
import Data.ByteString (ByteString)
Expand Down Expand Up @@ -258,13 +259,15 @@ connectClient rt conf = do
case result of
Left errFP -> do
err <- withForeignPtr errFP $ peek >=> cArrayToText
let err' = "Error connecting to Temporal server: " <> err
runStdoutLoggingT $ $(logWarn) err'
case retryConfig conf of
Nothing -> putMVar clientPtrSlot (throw $ ClientConnectionError err)
Nothing -> putMVar clientPtrSlot (throw $ ClientConnectionError err')
Just retryConf -> do
let delayMillis = fromIntegral (initialIntervalMillis retryConf) * multiplier retryConf ^ attempt
delayMicros = delayMillis * 1000
if (fmap fromIntegral (maxElapsedTimeMillis retryConf) < Just delayMillis) || (maxRetries retryConf <= attempt)
then putMVar clientPtrSlot (throw $ ClientConnectionError err)
then putMVar clientPtrSlot (throw $ ClientConnectionError err')
else do
threadDelay $ round delayMicros
go (attempt + 1)
Expand Down
1 change: 1 addition & 0 deletions core/temporal-sdk-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ library
, bytestring
, containers
, lens-family
, monad-logger
, mtl
, network-bsd
, proto-lens
Expand Down