<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55840/getaddrinfo-in-can-block-indefinitely-after-lte-connect</link><description>Hi, 
 I observed what appears to be the same issue as https://devzone.nordicsemi.com/f/nordic-q-a/51337/nrf9160-infinite-nrf_connect-blocking-behavior-post-lte-psm-wakeup/ . In my use-case however, I am not using PSM and instead just switch the modem</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Apr 2022 11:01:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55840/getaddrinfo-in-can-block-indefinitely-after-lte-connect" /><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/364674?ContentTypeID=1</link><pubDate>Mon, 25 Apr 2022 11:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a94358c3-daf9-4a1d-9cc4-5b538d7045b8</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="Didrik Rokhaug"]&lt;blockquote&gt;&lt;div&gt;johnwest said:&lt;/div&gt;&lt;div&gt;What is the timeout on getaddrinfo()?&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;
&lt;p&gt;I am not quite sure myself, but you should be able to test this out yourself. With the Trace Collector V2 Preview, you should be able to inspect the IP traffic in a modem trace yourself.&lt;/p&gt;[/quote]
&lt;p&gt;I managed to stumble over the answer: &amp;quot;Modem has four re-transmissions for DNS query. Timeout for first DNS request is 1 second and timeout for second, third and fourth DNS request is 3 seconds.&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/364221?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 12:35:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77aba767-8ed4-45a8-ab06-7ad2d7b9f3bc</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
[quote user="johnwest"]What is the timeout on getaddrinfo()?[/quote]
&lt;p&gt;I am not quite sure myself, but you should be able to test this out yourself. With the Trace Collector V2 Preview, you should be able to inspect the IP traffic in a modem trace yourself.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have any proper documentation for it yet (but it should be pretty self explanatory), but here is a guide on how to take a modem trace with the Trace Collector v1. It is the same steps on the device side.&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_trace_collector/UG/trace_collector/intro.html"&gt;https://infocenter.nordicsemi.com/topic/ug_trace_collector/UG/trace_collector/intro.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="johnwest"]Has a retry mechanism been added (lately) with a different timeout?[/quote]
&lt;p&gt;I am not aware of any changes to getaddrinfo&amp;#39;s behaviour.&lt;/p&gt;
[quote user="johnwest"]I suppose I could grep the zephyr codebase and find this someplace.[/quote]
&lt;p&gt;I expect that you are using the network stack in the modem, which is different from the one in Zephyr. So this will not give you anything useful.&lt;/p&gt;
[quote user="johnwest"]Is it possible the retry can deadlock?[/quote]
&lt;p&gt;Not that I am aware of. The modem FW has also been very thoroughly, so I would consider it unlikely.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/362453?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 19:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bebbd6a2-f33c-4f19-8e99-9db1a49e2c83</guid><dc:creator>johnwest</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/didrik-rokhaug"&gt;Didrik Rokhaug&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Didrik,&lt;/p&gt;
&lt;p&gt;What is the timeout on getaddrinfo()?&amp;nbsp; Has a retry mechanism been added (lately) with a different timeout?&amp;nbsp; I suppose I could grep the zephyr codebase and find this someplace.&amp;nbsp; Is it possible the retry can deadlock?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;John W.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/239047?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 10:22:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b153702-de54-429f-9f47-0dcab955ce5d</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I would recommend that you upgrade to the newest modem and NCS versions.&lt;/p&gt;
&lt;p&gt;I am not aware of any way to set a timeout to getaddrinfo, but it has one built in. So it shoudl time out if it is not able to contact any DNS servers, or provide another error code in other scenarios.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/238601?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 17:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:761a28d5-b051-4c6a-b239-a9b660cf8a8c</guid><dc:creator>phipi</dc:creator><description>&lt;p&gt;Hi Didrik, sorry for the late reply, this fell off my radar for a while. &lt;/p&gt;
&lt;p&gt;It sounds like this issue is similar to the one you link above but for me it seems getaddrinfo is hanging and never returns if it&amp;#39;s called without a cellular connection. Is there some way to add a timeout to this? What happens if the connection is lost between checking the connection and making the call to getaddrinfo?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/226889?ContentTypeID=1</link><pubDate>Fri, 27 Dec 2019 08:45:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ca559e0-9d06-44ec-9cc6-78b30af71aa8</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;How do you verify that you have connected to the cellular network?&lt;/p&gt;
&lt;p&gt;I had a ticket where getaddrinfo returned an error when not connected to the network: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/54841/getaddrinfo-returns-error-12-with-new-modem-firmware-1-1-0-worked-with-1-0-1"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/54841/getaddrinfo-returns-error-12-with-new-modem-firmware-1-1-0-worked-with-1-0-1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How is the signal strength where you are testing?&lt;/p&gt;
&lt;p&gt;If you are certain you are connected to the network, and the signal strength is good, could you take a modem trace when getaddrinfo hangs, so that we can analyze further?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/226765?ContentTypeID=1</link><pubDate>Mon, 23 Dec 2019 19:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c2c5137-20d8-48e2-b0a3-e7147aabb002</guid><dc:creator>phipi</dc:creator><description>&lt;p&gt;Hi Didrik, I&amp;#39;ve been working with Jeff on this. This doesn&amp;#39;t happen very often at all but it is occasionally encountered (maybe 1%). We are using NCS v1.1.0 and modem fw 1.1.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getaddrinfo in can block indefinitely after LTE connect</title><link>https://devzone.nordicsemi.com/thread/226561?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 12:48:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54e7402f-c537-44df-a72f-9300e498fc7b</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;What modem fw version and NCS version are you using?&lt;/p&gt;
&lt;p&gt;Also, could you define &amp;quot;occasionally&amp;quot; closer?&lt;/p&gt;
&lt;p&gt;Does it happen at regular intervals, or at random?&lt;/p&gt;
&lt;p&gt;I am aware of a problem that would happen after 30 disconnects and reconnects to the network, that at least was present in older modem fw versions.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>