Hi Curtis, thanks for the report. No, that isn't supposed to happen. I
haven't managed to reproduce a silent hang, and looking over the
virtual-connection code it looks like any errors (eg, TCP timeout) should
be propagated to the caller. On the other hand, I don't have a way of
simulating a network outage for testing, so maybe in that case the
connection never realizes it is no longer connected, unlike the things I
tried.

Could you run your program with db logging at the debug level (eg, set the
environment variable PLTSTDERR to "debug@db error") and also add `#:debug?
#t` to your call to `postgresql-connect` and see what gets logged/printed
before the hang occurs? (You may want to redact the output.)

Ryan

On Fri, Jul 3, 2020 at 5:07 PM Curtis Dutton <[email protected]> wrote:

> Ok well on additional investigation this appears only to happen while
> using virtual connections. If a raw postgresql-connect is used it does
> raise a tcp timeout error.
>
> On Fri, Jul 3, 2020 at 10:51 AM Curtis Dutton <[email protected]> wrote:
>
>> I'm in the process of writing a simple daemon that periodically checks in
>> with a postgres database. I'm trying to make it resilient with network
>> outages.
>>
>>
>> If you connect to the database.
>> Unplug the network cable.
>> Run a query.
>>
>> The query will hang for what appears to be forever without throwing an
>> exception.
>>
>> Is this expected behavior?
>>
>>
>> Thanks,
>>     Curtis
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAPChLEqzeN3FjhD59tTHUf3EFgW8Bo0xi_3e3Va5kPg2Ut7miA%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAPChLEqzeN3FjhD59tTHUf3EFgW8Bo0xi_3e3Va5kPg2Ut7miA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CANy33qkN3tUxav9xkVnnWrA9Hd1K9JBhOdwAzSxJgDmDXtVkeg%40mail.gmail.com.

Reply via email to