Re: [racket-users] Re: DB hangs with postgres and broken network link

2020-07-03 Thread James Platt
I wonder if this is a more general TCP/IP issue rather than anything Postgres 
specific.  I'm troubleshooting an issue where a TCP connection to a server is 
unexpectedly going down, once in a while, with no obvious indication.  The 
solution, for now, is to have the client send a sort of ping over the TCP 
connection to the server every so often and then establish a new connection if 
it doesn't get a response.  In other words, when the connection goes down, 
trying to send something over it from the client does not generate an error.  I 
haven't found an indication on either the client or server.  So, to detect the 
connection failure, you have to look for a lack of response.  This is an 
intermittent failure and, as such, very annoying to troubleshoot.

-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87B3E760-332A-4D45-8D1F-0CE9180A2138%40biomantica.com.


Re: [racket-users] Re: DB hangs with postgres and broken network link

2020-07-03 Thread Ryan Culpepper
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  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  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 racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAPChLEqzeN3FjhD59tTHUf3EFgW8Bo0xi_3e3Va5kPg2Ut7miA%40mail.gmail.com
> 
> .
>

-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CANy33qkN3tUxav9xkVnnWrA9Hd1K9JBhOdwAzSxJgDmDXtVkeg%40mail.gmail.com.


[racket-users] New package: place-controllers

2020-07-03 Thread Sage Gerard
Here's a way to encapsulate places in a generator-like procedure: 
[https://docs.racket-lang.org/place-controller/index.html](https://docs.racket-lang.org/place-controller/index.html?q=place%20con)

I ended up writing this to support a parallel build model, such that a single 
(apply sync (p1) (p2) ...) returns a value or status from a place, along with 
helpful context.

Source code is available at https://github.com/zyrolasting/place-controller

~slg

-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/u08zPAJEDNgniFXvSgnTcupRTawCu9BaOM3WzNnxeZOhjQRKPvNCMJNbfdSGEFxfKZl-Hd1RXFkUfnEiJYCTZ_jS1FCBQGqq84wRJ0OT664%3D%40sagegerard.com.


[racket-users] Re: DB hangs with postgres and broken network link

2020-07-03 Thread Curtis Dutton
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  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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAPChLEqzeN3FjhD59tTHUf3EFgW8Bo0xi_3e3Va5kPg2Ut7miA%40mail.gmail.com.


[racket-users] DB hangs with postgres and broken network link

2020-07-03 Thread Curtis Dutton
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAPChLEqQgoSxFVp1p8uxWZW-kGrFWO6s7jHFur6fACDsfhgXqA%40mail.gmail.com.