SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
Lasso 8.6.3 on Mac.

Like many others, a client's server suffers from SMTP issues. Sending
mail stops working after an hour or so.
In this case, restarting the email queue does not help but restarting
Lasso makes it work again.

include_url keeps working which rules out DNS deafness.

When the email queue stops working, email_pop stops working too. Since
both SMTP and POP are implemented with the Net type I looked closer at
that.

It turns out that net -> wait stops working efter a while. It returns
net_timeout even if the remote host is responding properly, and that
causes both POP and SMTP to stop working.


Here is some test code.

var('net' = net);
Var('Result' = $net -> connect('localhost', 80));
Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
var('waitresult' = $net -> wait(2, net_waitwrite));
if($waitresult==net_waitread);
    'Ready to read';
else($waitresult==net_waitwrite);
    'Ready to write';
else($waitresult==net_waittimeout);
    'Timeout';
/if;
if($waitresult == net_waitwrite);
    $net -> Write('GET / HTTP/1.0r\n\r\n');
    $net -> Wait(2, net_waitread);
    $net -> Read(32768);
/if;
$net -> close;


In normal cases, we get "Ready to write" and then the http output from
localhost.

When net -> wait stops working, we just get a timeout. In that case we
can remove the $net -> wait statements and everything works again, but
then we run in blind mode without knowing what's happening in the
communication.

Any ideas what can make net -> wait stop working?


--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
I've implemented the NOHUP fix as well, but I think that's mainly
aiming at DNS deafness.

2015-08-05 9:26 GMT+02:00 Johan Solve <[hidden email]>:

> Lasso 8.6.3 on Mac.
>
> Like many others, a client's server suffers from SMTP issues. Sending
> mail stops working after an hour or so.
> In this case, restarting the email queue does not help but restarting
> Lasso makes it work again.
>
> include_url keeps working which rules out DNS deafness.
>
> When the email queue stops working, email_pop stops working too. Since
> both SMTP and POP are implemented with the Net type I looked closer at
> that.
>
> It turns out that net -> wait stops working efter a while. It returns
> net_timeout even if the remote host is responding properly, and that
> causes both POP and SMTP to stop working.
>
>
> Here is some test code.
>
> var('net' = net);
> Var('Result' = $net -> connect('localhost', 80));
> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
> var('waitresult' = $net -> wait(2, net_waitwrite));
> if($waitresult==net_waitread);
>     'Ready to read';
> else($waitresult==net_waitwrite);
>     'Ready to write';
> else($waitresult==net_waittimeout);
>     'Timeout';
> /if;
> if($waitresult == net_waitwrite);
>     $net -> Write('GET / HTTP/1.0r\n\r\n');
>     $net -> Wait(2, net_waitread);
>     $net -> Read(32768);
> /if;
> $net -> close;
>
>
> In normal cases, we get "Ready to write" and then the http output from
> localhost.
>
> When net -> wait stops working, we just get a timeout. In that case we
> can remove the $net -> wait statements and everything works again, but
> then we run in blind mode without knowing what's happening in the
> communication.
>
> Any ideas what can make net -> wait stop working?
>
>
> --
> Mvh
> Johan Sölve
> ____________________________________
> Montania System AB
> Halmstad   Stockholm
> http://www.montania.se
>
> Johan Sölve
> Mobil +46 709-51 55 70
> [hidden email]
>
> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> Telefon +46 35-136800 |  Fax +46 35-136801



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Bil Corry-3
In reply to this post by Johan Solve
Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.

Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.

- Bil

> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>
> Lasso 8.6.3 on Mac.
>
> Like many others, a client's server suffers from SMTP issues. Sending
> mail stops working after an hour or so.
> In this case, restarting the email queue does not help but restarting
> Lasso makes it work again.
>
> include_url keeps working which rules out DNS deafness.
>
> When the email queue stops working, email_pop stops working too. Since
> both SMTP and POP are implemented with the Net type I looked closer at
> that.
>
> It turns out that net -> wait stops working efter a while. It returns
> net_timeout even if the remote host is responding properly, and that
> causes both POP and SMTP to stop working.
>
>
> Here is some test code.
>
> var('net' = net);
> Var('Result' = $net -> connect('localhost', 80));
> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
> var('waitresult' = $net -> wait(2, net_waitwrite));
> if($waitresult==net_waitread);
>    'Ready to read';
> else($waitresult==net_waitwrite);
>    'Ready to write';
> else($waitresult==net_waittimeout);
>    'Timeout';
> /if;
> if($waitresult == net_waitwrite);
>    $net -> Write('GET / HTTP/1.0r\n\r\n');
>    $net -> Wait(2, net_waitread);
>    $net -> Read(32768);
> /if;
> $net -> close;
>
>
> In normal cases, we get "Ready to write" and then the http output from
> localhost.
>
> When net -> wait stops working, we just get a timeout. In that case we
> can remove the $net -> wait statements and everything works again, but
> then we run in blind mode without knowing what's happening in the
> communication.
>
> Any ideas what can make net -> wait stop working?
>
>
> --
> Mvh
> Johan Sölve
> ____________________________________
> Montania System AB
> Halmstad   Stockholm
> http://www.montania.se
>
> Johan Sölve
> Mobil +46 709-51 55 70
> [hidden email]
>
> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> Telefon +46 35-136800 |  Fax +46 35-136801
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Ke Carlton-3
I was thinking a similar thing when I saw the code.

Normally I would do something like this:

local(net) = net_tcp
#net->connect(...)
handle => {#net->close}
#rest of code

This way the connections are always even if there's an error in the #rest
of code. But that won't happen here:

#net->connect(...)
#rest of code
#net->close

Same concepts apply to L8, I believe handle; /handle; exists.

Ke

On Wed, Aug 5, 2015 at 7:47 PM Bil Corry <[hidden email]> wrote:

>
> Do you know how many TCP connections are in an open state when it stops
> working? Maybe it runs out of connections/sockets.
>
>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
Good call.

2015-08-05 9:52 GMT+02:00 Ke Carlton <[hidden email]>:

> I was thinking a similar thing when I saw the code.
>
> Normally I would do something like this:
>
> local(net) = net_tcp
> #net->connect(...)
> handle => {#net->close}
> #rest of code
>
> This way the connections are always even if there's an error in the #rest
> of code. But that won't happen here:
>
> #net->connect(...)
> #rest of code
> #net->close
>
> Same concepts apply to L8, I believe handle; /handle; exists.
>
> Ke
>
> On Wed, Aug 5, 2015 at 7:47 PM Bil Corry <[hidden email]> wrote:
>
>>
>> Do you know how many TCP connections are in an open state when it stops
>> working? Maybe it runs out of connections/sockets.
>>
>>
>>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
In reply to this post by Bil Corry-3
Like this?

netstat -n -p tcp |wc -l

2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:

> Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.
>
> Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.
>
> - Bil
>
>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>>
>> Lasso 8.6.3 on Mac.
>>
>> Like many others, a client's server suffers from SMTP issues. Sending
>> mail stops working after an hour or so.
>> In this case, restarting the email queue does not help but restarting
>> Lasso makes it work again.
>>
>> include_url keeps working which rules out DNS deafness.
>>
>> When the email queue stops working, email_pop stops working too. Since
>> both SMTP and POP are implemented with the Net type I looked closer at
>> that.
>>
>> It turns out that net -> wait stops working efter a while. It returns
>> net_timeout even if the remote host is responding properly, and that
>> causes both POP and SMTP to stop working.
>>
>>
>> Here is some test code.
>>
>> var('net' = net);
>> Var('Result' = $net -> connect('localhost', 80));
>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
>> var('waitresult' = $net -> wait(2, net_waitwrite));
>> if($waitresult==net_waitread);
>>    'Ready to read';
>> else($waitresult==net_waitwrite);
>>    'Ready to write';
>> else($waitresult==net_waittimeout);
>>    'Timeout';
>> /if;
>> if($waitresult == net_waitwrite);
>>    $net -> Write('GET / HTTP/1.0r\n\r\n');
>>    $net -> Wait(2, net_waitread);
>>    $net -> Read(32768);
>> /if;
>> $net -> close;
>>
>>
>> In normal cases, we get "Ready to write" and then the http output from
>> localhost.
>>
>> When net -> wait stops working, we just get a timeout. In that case we
>> can remove the $net -> wait statements and everything works again, but
>> then we run in blind mode without knowing what's happening in the
>> communication.
>>
>> Any ideas what can make net -> wait stop working?
>>
>>
>> --
>> Mvh
>> Johan Sölve
>> ____________________________________
>> Montania System AB
>> Halmstad   Stockholm
>> http://www.montania.se
>>
>> Johan Sölve
>> Mobil +46 709-51 55 70
>> [hidden email]
>>
>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>> Telefon +46 35-136800 |  Fax +46 35-136801
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
In reply to this post by Bil Corry-3
The connection is actually working, it's just the net->wait that
fails. Doesn't that talk against running out of sockets?

2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:

> Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.
>
> Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.
>
> - Bil
>
>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>>
>> Lasso 8.6.3 on Mac.
>>
>> Like many others, a client's server suffers from SMTP issues. Sending
>> mail stops working after an hour or so.
>> In this case, restarting the email queue does not help but restarting
>> Lasso makes it work again.
>>
>> include_url keeps working which rules out DNS deafness.
>>
>> When the email queue stops working, email_pop stops working too. Since
>> both SMTP and POP are implemented with the Net type I looked closer at
>> that.
>>
>> It turns out that net -> wait stops working efter a while. It returns
>> net_timeout even if the remote host is responding properly, and that
>> causes both POP and SMTP to stop working.
>>
>>
>> Here is some test code.
>>
>> var('net' = net);
>> Var('Result' = $net -> connect('localhost', 80));
>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
>> var('waitresult' = $net -> wait(2, net_waitwrite));
>> if($waitresult==net_waitread);
>>    'Ready to read';
>> else($waitresult==net_waitwrite);
>>    'Ready to write';
>> else($waitresult==net_waittimeout);
>>    'Timeout';
>> /if;
>> if($waitresult == net_waitwrite);
>>    $net -> Write('GET / HTTP/1.0r\n\r\n');
>>    $net -> Wait(2, net_waitread);
>>    $net -> Read(32768);
>> /if;
>> $net -> close;
>>
>>
>> In normal cases, we get "Ready to write" and then the http output from
>> localhost.
>>
>> When net -> wait stops working, we just get a timeout. In that case we
>> can remove the $net -> wait statements and everything works again, but
>> then we run in blind mode without knowing what's happening in the
>> communication.
>>
>> Any ideas what can make net -> wait stop working?
>>
>>
>> --
>> Mvh
>> Johan Sölve
>> ____________________________________
>> Montania System AB
>> Halmstad   Stockholm
>> http://www.montania.se
>>
>> Johan Sölve
>> Mobil +46 709-51 55 70
>> [hidden email]
>>
>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>> Telefon +46 35-136800 |  Fax +46 35-136801
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
Just had a timeout again. 17 open TCP connections at that moment,
that's nothing. Ok, that rules it out.

2015-08-05 10:45 GMT+02:00 Johan Solve <[hidden email]>:

> The connection is actually working, it's just the net->wait that
> fails. Doesn't that talk against running out of sockets?
>
> 2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:
>> Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.
>>
>> Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.
>>
>> - Bil
>>
>>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>>>
>>> Lasso 8.6.3 on Mac.
>>>
>>> Like many others, a client's server suffers from SMTP issues. Sending
>>> mail stops working after an hour or so.
>>> In this case, restarting the email queue does not help but restarting
>>> Lasso makes it work again.
>>>
>>> include_url keeps working which rules out DNS deafness.
>>>
>>> When the email queue stops working, email_pop stops working too. Since
>>> both SMTP and POP are implemented with the Net type I looked closer at
>>> that.
>>>
>>> It turns out that net -> wait stops working efter a while. It returns
>>> net_timeout even if the remote host is responding properly, and that
>>> causes both POP and SMTP to stop working.
>>>
>>>
>>> Here is some test code.
>>>
>>> var('net' = net);
>>> Var('Result' = $net -> connect('localhost', 80));
>>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
>>> var('waitresult' = $net -> wait(2, net_waitwrite));
>>> if($waitresult==net_waitread);
>>>    'Ready to read';
>>> else($waitresult==net_waitwrite);
>>>    'Ready to write';
>>> else($waitresult==net_waittimeout);
>>>    'Timeout';
>>> /if;
>>> if($waitresult == net_waitwrite);
>>>    $net -> Write('GET / HTTP/1.0r\n\r\n');
>>>    $net -> Wait(2, net_waitread);
>>>    $net -> Read(32768);
>>> /if;
>>> $net -> close;
>>>
>>>
>>> In normal cases, we get "Ready to write" and then the http output from
>>> localhost.
>>>
>>> When net -> wait stops working, we just get a timeout. In that case we
>>> can remove the $net -> wait statements and everything works again, but
>>> then we run in blind mode without knowing what's happening in the
>>> communication.
>>>
>>> Any ideas what can make net -> wait stop working?
>>>
>>>
>>> --
>>> Mvh
>>> Johan Sölve
>>> ____________________________________
>>> Montania System AB
>>> Halmstad   Stockholm
>>> http://www.montania.se
>>>
>>> Johan Sölve
>>> Mobil +46 709-51 55 70
>>> [hidden email]
>>>
>>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>>> Telefon +46 35-136800 |  Fax +46 35-136801
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
>
> --
> Mvh
> Johan Sölve
> ____________________________________
> Montania System AB
> Halmstad   Stockholm
> http://www.montania.se
>
> Johan Sölve
> Mobil +46 709-51 55 70
> [hidden email]
>
> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> Telefon +46 35-136800 |  Fax +46 35-136801



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
I made a script that keeps track of these net->wait failures and
restarts the Lasso site when they appear.

https://gist.github.com/johansolve/afd58ea1a22a352977db


2015-08-05 11:02 GMT+02:00 Johan Solve <[hidden email]>:

> Just had a timeout again. 17 open TCP connections at that moment,
> that's nothing. Ok, that rules it out.
>
> 2015-08-05 10:45 GMT+02:00 Johan Solve <[hidden email]>:
>> The connection is actually working, it's just the net->wait that
>> fails. Doesn't that talk against running out of sockets?
>>
>> 2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:
>>> Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.
>>>
>>> Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.
>>>
>>> - Bil
>>>
>>>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>>>>
>>>> Lasso 8.6.3 on Mac.
>>>>
>>>> Like many others, a client's server suffers from SMTP issues. Sending
>>>> mail stops working after an hour or so.
>>>> In this case, restarting the email queue does not help but restarting
>>>> Lasso makes it work again.
>>>>
>>>> include_url keeps working which rules out DNS deafness.
>>>>
>>>> When the email queue stops working, email_pop stops working too. Since
>>>> both SMTP and POP are implemented with the Net type I looked closer at
>>>> that.
>>>>
>>>> It turns out that net -> wait stops working efter a while. It returns
>>>> net_timeout even if the remote host is responding properly, and that
>>>> causes both POP and SMTP to stop working.
>>>>
>>>>
>>>> Here is some test code.
>>>>
>>>> var('net' = net);
>>>> Var('Result' = $net -> connect('localhost', 80));
>>>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
>>>> var('waitresult' = $net -> wait(2, net_waitwrite));
>>>> if($waitresult==net_waitread);
>>>>    'Ready to read';
>>>> else($waitresult==net_waitwrite);
>>>>    'Ready to write';
>>>> else($waitresult==net_waittimeout);
>>>>    'Timeout';
>>>> /if;
>>>> if($waitresult == net_waitwrite);
>>>>    $net -> Write('GET / HTTP/1.0r\n\r\n');
>>>>    $net -> Wait(2, net_waitread);
>>>>    $net -> Read(32768);
>>>> /if;
>>>> $net -> close;
>>>>
>>>>
>>>> In normal cases, we get "Ready to write" and then the http output from
>>>> localhost.
>>>>
>>>> When net -> wait stops working, we just get a timeout. In that case we
>>>> can remove the $net -> wait statements and everything works again, but
>>>> then we run in blind mode without knowing what's happening in the
>>>> communication.
>>>>
>>>> Any ideas what can make net -> wait stop working?
>>>>
>>>>
>>>> --
>>>> Mvh
>>>> Johan Sölve
>>>> ____________________________________
>>>> Montania System AB
>>>> Halmstad   Stockholm
>>>> http://www.montania.se
>>>>
>>>> Johan Sölve
>>>> Mobil +46 709-51 55 70
>>>> [hidden email]
>>>>
>>>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>>>> Telefon +46 35-136800 |  Fax +46 35-136801
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>   the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>>
>> --
>> Mvh
>> Johan Sölve
>> ____________________________________
>> Montania System AB
>> Halmstad   Stockholm
>> http://www.montania.se
>>
>> Johan Sölve
>> Mobil +46 709-51 55 70
>> [hidden email]
>>
>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>> Telefon +46 35-136800 |  Fax +46 35-136801
>
>
>
> --
> Mvh
> Johan Sölve
> ____________________________________
> Montania System AB
> Halmstad   Stockholm
> http://www.montania.se
>
> Johan Sölve
> Mobil +46 709-51 55 70
> [hidden email]
>
> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> Telefon +46 35-136800 |  Fax +46 35-136801



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Bil Corry-3
In reply to this post by Johan Solve
I was thinking the entire socket system was over-burdened or not enough handles, etc. and was reading the "ready" status from the wrong socket.


- Bil

> On Aug 5, 2015, at 10:45 AM, Johan Solve <[hidden email]> wrote:
>
> The connection is actually working, it's just the net->wait that
> fails. Doesn't that talk against running out of sockets?
>
> 2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:
>> Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.
>>
>> Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.
>>
>> - Bil
>>
>>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>>>
>>> Lasso 8.6.3 on Mac.
>>>
>>> Like many others, a client's server suffers from SMTP issues. Sending
>>> mail stops working after an hour or so.
>>> In this case, restarting the email queue does not help but restarting
>>> Lasso makes it work again.
>>>
>>> include_url keeps working which rules out DNS deafness.
>>>
>>> When the email queue stops working, email_pop stops working too. Since
>>> both SMTP and POP are implemented with the Net type I looked closer at
>>> that.
>>>
>>> It turns out that net -> wait stops working efter a while. It returns
>>> net_timeout even if the remote host is responding properly, and that
>>> causes both POP and SMTP to stop working.
>>>
>>>
>>> Here is some test code.
>>>
>>> var('net' = net);
>>> Var('Result' = $net -> connect('localhost', 80));
>>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
>>> var('waitresult' = $net -> wait(2, net_waitwrite));
>>> if($waitresult==net_waitread);
>>>   'Ready to read';
>>> else($waitresult==net_waitwrite);
>>>   'Ready to write';
>>> else($waitresult==net_waittimeout);
>>>   'Timeout';
>>> /if;
>>> if($waitresult == net_waitwrite);
>>>   $net -> Write('GET / HTTP/1.0r\n\r\n');
>>>   $net -> Wait(2, net_waitread);
>>>   $net -> Read(32768);
>>> /if;
>>> $net -> close;
>>>
>>>
>>> In normal cases, we get "Ready to write" and then the http output from
>>> localhost.
>>>
>>> When net -> wait stops working, we just get a timeout. In that case we
>>> can remove the $net -> wait statements and everything works again, but
>>> then we run in blind mode without knowing what's happening in the
>>> communication.
>>>
>>> Any ideas what can make net -> wait stop working?
>>>
>>>
>>> --
>>> Mvh
>>> Johan Sölve
>>> ____________________________________
>>> Montania System AB
>>> Halmstad   Stockholm
>>> http://www.montania.se
>>>
>>> Johan Sölve
>>> Mobil +46 709-51 55 70
>>> [hidden email]
>>>
>>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>>> Telefon +46 35-136800 |  Fax +46 35-136801
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
>
> --
> Mvh
> Johan Sölve
> ____________________________________
> Montania System AB
> Halmstad   Stockholm
> http://www.montania.se
>
> Johan Sölve
> Mobil +46 709-51 55 70
> [hidden email]
>
> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> Telefon +46 35-136800 |  Fax +46 35-136801
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Johan Solve
It turned out that the watch script I wrote somehow lost it's ability
to detect errors after a while. It loop kept running and continued to
perform checks, but all checks returned ok even if an outside check
with the same code showed failure. I couldn't figure out what really
happened with the infinite loop that made it stop working. I tried
deleting and creating a new instance of the net variable for every
check, but that didn't help.

So I split the watch script into two files. One in LassoStartup that
starts an infinite loop with include_url for the other file that is
placed in web root. Using include_url guarantees that the actual check
is performed completely independent of the infinit loop thread.
This has been running for a week now and restarts the site promptly
when the net->wait stops working which makes POP and SMTP fail.

https://gist.github.com/johansolve/afd58ea1a22a352977db (two files now)

I'm thinking that this might be useful to look at for those who have
issues with stalling email queue. Also my issues with the infinite
loop failing after a while might be related to the issues with the
email queue that some are reporting.

2015-08-05 13:52 GMT+02:00 Bil Corry <[hidden email]>:

> I was thinking the entire socket system was over-burdened or not enough handles, etc. and was reading the "ready" status from the wrong socket.
>
>
> - Bil
>
>> On Aug 5, 2015, at 10:45 AM, Johan Solve <[hidden email]> wrote:
>>
>> The connection is actually working, it's just the net->wait that
>> fails. Doesn't that talk against running out of sockets?
>>
>> 2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:
>>> Might be worth trying to overload net -> wait to wait X ms (100?), then return the status code for a successful connection, and see if that gets it mostly working.
>>>
>>> Do you know how many TCP connections are in an open state when it stops working? Maybe it runs out of connections/sockets.
>>>
>>> - Bil
>>>
>>>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]> wrote:
>>>>
>>>> Lasso 8.6.3 on Mac.
>>>>
>>>> Like many others, a client's server suffers from SMTP issues. Sending
>>>> mail stops working after an hour or so.
>>>> In this case, restarting the email queue does not help but restarting
>>>> Lasso makes it work again.
>>>>
>>>> include_url keeps working which rules out DNS deafness.
>>>>
>>>> When the email queue stops working, email_pop stops working too. Since
>>>> both SMTP and POP are implemented with the Net type I looked closer at
>>>> that.
>>>>
>>>> It turns out that net -> wait stops working efter a while. It returns
>>>> net_timeout even if the remote host is responding properly, and that
>>>> causes both POP and SMTP to stop working.
>>>>
>>>>
>>>> Here is some test code.
>>>>
>>>> var('net' = net);
>>>> Var('Result' = $net -> connect('localhost', 80));
>>>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
>>>> var('waitresult' = $net -> wait(2, net_waitwrite));
>>>> if($waitresult==net_waitread);
>>>>   'Ready to read';
>>>> else($waitresult==net_waitwrite);
>>>>   'Ready to write';
>>>> else($waitresult==net_waittimeout);
>>>>   'Timeout';
>>>> /if;
>>>> if($waitresult == net_waitwrite);
>>>>   $net -> Write('GET / HTTP/1.0r\n\r\n');
>>>>   $net -> Wait(2, net_waitread);
>>>>   $net -> Read(32768);
>>>> /if;
>>>> $net -> close;
>>>>
>>>>
>>>> In normal cases, we get "Ready to write" and then the http output from
>>>> localhost.
>>>>
>>>> When net -> wait stops working, we just get a timeout. In that case we
>>>> can remove the $net -> wait statements and everything works again, but
>>>> then we run in blind mode without knowing what's happening in the
>>>> communication.
>>>>
>>>> Any ideas what can make net -> wait stop working?
>>>>
>>>>
>>>> --
>>>> Mvh
>>>> Johan Sölve
>>>> ____________________________________
>>>> Montania System AB
>>>> Halmstad   Stockholm
>>>> http://www.montania.se
>>>>
>>>> Johan Sölve
>>>> Mobil +46 709-51 55 70
>>>> [hidden email]
>>>>
>>>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>>>> Telefon +46 35-136800 |  Fax +46 35-136801
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>>
>> --
>> Mvh
>> Johan Sölve
>> ____________________________________
>> Montania System AB
>> Halmstad   Stockholm
>> http://www.montania.se
>>
>> Johan Sölve
>> Mobil +46 709-51 55 70
>> [hidden email]
>>
>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
>> Telefon +46 35-136800 |  Fax +46 35-136801
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: SMTP and POP problems on 8.6.3 Mac - caused by net -> wait?

Bil Corry-3
Reminds me of when I wanted to use include_url inside an infinite loop to
test a remote site (using Lasso 8), but at some point it would stop
working, so instead, I used include_url to load a local page, which in turn
used include_url to test the remote site.

Glad you got this working, thanks for the tip.

- Bil

On Fri, Aug 14, 2015 at 1:20 PM, Johan Solve <[hidden email]> wrote:

> It turned out that the watch script I wrote somehow lost it's ability
> to detect errors after a while. It loop kept running and continued to
> perform checks, but all checks returned ok even if an outside check
> with the same code showed failure. I couldn't figure out what really
> happened with the infinite loop that made it stop working. I tried
> deleting and creating a new instance of the net variable for every
> check, but that didn't help.
>
> So I split the watch script into two files. One in LassoStartup that
> starts an infinite loop with include_url for the other file that is
> placed in web root. Using include_url guarantees that the actual check
> is performed completely independent of the infinit loop thread.
> This has been running for a week now and restarts the site promptly
> when the net->wait stops working which makes POP and SMTP fail.
>
> https://gist.github.com/johansolve/afd58ea1a22a352977db (two files now)
>
> I'm thinking that this might be useful to look at for those who have
> issues with stalling email queue. Also my issues with the infinite
> loop failing after a while might be related to the issues with the
> email queue that some are reporting.
>
> 2015-08-05 13:52 GMT+02:00 Bil Corry <[hidden email]>:
> > I was thinking the entire socket system was over-burdened or not enough
> handles, etc. and was reading the "ready" status from the wrong socket.
> >
> >
> > - Bil
> >
> >> On Aug 5, 2015, at 10:45 AM, Johan Solve <[hidden email]> wrote:
> >>
> >> The connection is actually working, it's just the net->wait that
> >> fails. Doesn't that talk against running out of sockets?
> >>
> >> 2015-08-05 9:47 GMT+02:00 Bil Corry <[hidden email]>:
> >>> Might be worth trying to overload net -> wait to wait X ms (100?),
> then return the status code for a successful connection, and see if that
> gets it mostly working.
> >>>
> >>> Do you know how many TCP connections are in an open state when it
> stops working? Maybe it runs out of connections/sockets.
> >>>
> >>> - Bil
> >>>
> >>>> On Aug 5, 2015, at 9:26 AM, Johan Solve <[hidden email]>
> wrote:
> >>>>
> >>>> Lasso 8.6.3 on Mac.
> >>>>
> >>>> Like many others, a client's server suffers from SMTP issues. Sending
> >>>> mail stops working after an hour or so.
> >>>> In this case, restarting the email queue does not help but restarting
> >>>> Lasso makes it work again.
> >>>>
> >>>> include_url keeps working which rules out DNS deafness.
> >>>>
> >>>> When the email queue stops working, email_pop stops working too. Since
> >>>> both SMTP and POP are implemented with the Net type I looked closer at
> >>>> that.
> >>>>
> >>>> It turns out that net -> wait stops working efter a while. It returns
> >>>> net_timeout even if the remote host is responding properly, and that
> >>>> causes both POP and SMTP to stop working.
> >>>>
> >>>>
> >>>> Here is some test code.
> >>>>
> >>>> var('net' = net);
> >>>> Var('Result' = $net -> connect('localhost', 80));
> >>>> Fail_If($Result != Net_ConnectOK, (-1), 'TCP Error');
> >>>> var('waitresult' = $net -> wait(2, net_waitwrite));
> >>>> if($waitresult==net_waitread);
> >>>>   'Ready to read';
> >>>> else($waitresult==net_waitwrite);
> >>>>   'Ready to write';
> >>>> else($waitresult==net_waittimeout);
> >>>>   'Timeout';
> >>>> /if;
> >>>> if($waitresult == net_waitwrite);
> >>>>   $net -> Write('GET / HTTP/1.0r\n\r\n');
> >>>>   $net -> Wait(2, net_waitread);
> >>>>   $net -> Read(32768);
> >>>> /if;
> >>>> $net -> close;
> >>>>
> >>>>
> >>>> In normal cases, we get "Ready to write" and then the http output from
> >>>> localhost.
> >>>>
> >>>> When net -> wait stops working, we just get a timeout. In that case we
> >>>> can remove the $net -> wait statements and everything works again, but
> >>>> then we run in blind mode without knowing what's happening in the
> >>>> communication.
> >>>>
> >>>> Any ideas what can make net -> wait stop working?
> >>>>
> >>>>
> >>>> --
> >>>> Mvh
> >>>> Johan Sölve
> >>>> ____________________________________
> >>>> Montania System AB
> >>>> Halmstad   Stockholm
> >>>> http://www.montania.se
> >>>>
> >>>> Johan Sölve
> >>>> Mobil +46 709-51 55 70
> >>>> [hidden email]
> >>>>
> >>>> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> >>>> Telefon +46 35-136800 |  Fax +46 35-136801
> >>>>
> >>>> #############################################################
> >>>>
> >>>> This message is sent to you because you are subscribed to
> >>>> the mailing list Lasso [hidden email]
> >>>> Official list archives available at http://www.lassotalk.com
> >>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>> Send administrative queries to  <[hidden email]>
> >>>
> >>> #############################################################
> >>>
> >>> This message is sent to you because you are subscribed to
> >>>  the mailing list Lasso [hidden email]
> >>> Official list archives available at http://www.lassotalk.com
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>
> >>
> >>
> >> --
> >> Mvh
> >> Johan Sölve
> >> ____________________________________
> >> Montania System AB
> >> Halmstad   Stockholm
> >> http://www.montania.se
> >>
> >> Johan Sölve
> >> Mobil +46 709-51 55 70
> >> [hidden email]
> >>
> >> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> >> Telefon +46 35-136800 |  Fax +46 35-136801
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >>  the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >   the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
>
> --
> Mvh
> Johan Sölve
> ____________________________________
> Montania System AB
> Halmstad   Stockholm
> http://www.montania.se
>
> Johan Sölve
> Mobil +46 709-51 55 70
> [hidden email]
>
> Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
> Telefon +46 35-136800 |  Fax +46 35-136801
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>