<div dir="ltr">Il giorno lun 12 ago 2024 alle ore 11:02 Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> ha scritto:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
First off, I can't reproduce the problem - even if I double the number <br>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">of URLs to 200.<br></blockquote><div><br></div><div>That's odd.<br></div><div>I just tried on another VM (lubuntu 24.04 on live cd) and I can still reproduce both with the builtin PyQt5 (Qt 5.15.13, PyQt 5.15.10) and PyQt6 (6.7.1) installed through pip.</div><div>In some cases it never even get beyond 10 finished replies, and this also seems to be related by the number of current requests: if I reduce the timer interval to 10-20ms in some cases it just segfaults at the very first finished reply (I can see it if I connect to the "doSomething" function before any other).</div><div>I suppose then that it's also related to the number of currently active/queued requests, so maybe in my case it fails almost always due to the relatively slow network speed I have (also decreased by the VM bottleneck)<br></div><div>Can you try by decreasing the timeout interval and slowing down the response time?</div>I made some reliable tests with <a href="https://httpbin.org/delay/1">https://httpbin.org/delay/1</a> (one second delay), PyQt6 gets rarely more than 20 results before fault, Qt5 often crashes on the very first one.<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
However looking at the reply object using sip.dump() shows it has no <br>
parent wrapped object whereas the docs for QNetworkReply::manager() <br>
state that the manager is the reply's parent. Adding a /Transfer/ <br>
annotation to QNetworkManager::get() fixes this - but I have no idea if <br>
this has any effect on your test case.<br></blockquote><div><br></div><div>That would be interesting to explore, but I wouldn't be able to build/test it on my own.</div><div>How come that sip.dump() doesn't show the parent, while I'm able to print out both manager() and parent()?</div><div><br></div><div>In the meantime, I decided to create a persistent list for the replies, and then remove each one when finished/destroyed.</div><div>It seems to work so far, both in the provided MRE (including the stress cases above) and in my actual program.</div><div><br></div><div>Thanks,</div><div>MaurizioB<br></div></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div></div>