-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp_http_client fails due to base_poll_read() select() usage (IDFGH-13821) #14673
Comments
@david-cermak |
@AxelLin the fix is already under review. Should be on master soon. |
@euripedesrocha |
Hello @AxelLin , We've already submitted a merge request for this fix, and we're currently testing it across additional scenarios to ensure stability. It should be merged soon. |
@nileshkale123 @euripedesrocha I'm testing on v5.2 branch. UPDATE: |
Your reply gives people the expect that this will be fix soon. |
Hello @AxelLin, Could you please provide the exact testing scenario in detail to help us reproduce this issue? Specifically, I would like to know how you are starting the server and which example you are running. Previously, I raised an MR based on your explanation, as it seemed logically correct. However, I have not been able to reproduce the issue exactly as you described so far, so any additional details would be really helpful. Additionally, could you try applying the following patch on the release/v5.2 branch and test it again? Please share any updates or progress on your results. |
@nileshkale123 This issue was reported by @gonzzor, not me. |
@AxelLin I'm using my suggested change in transport_ssl.c in production and it for sure improved things, haven't seen any more problems with it. The second part mentioned in #14673 (comment) seem to have been merged already in #14724 so I don't see any problems with that change. In addition, when testing this I'm using the python http.server module to simply serve files locally to my board. I didn't have problems all the time and it seem to be timing related as the size of file impacted things. I could see the issue when connected via uart and pppd running on Linux. |
Answers checklist.
IDF version.
v5.3.1
Espressif SoC revision.
ESP32-S3
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Custom board
Power Supply used.
External 3.3V
What is the expected behavior?
Reliably download files with esp_http_client() even when the last IP packets arrive quickly.
What is the actual behavior?
esp_http_client_read() return an error instead of the last data.
Steps to reproduce.
Debug Logs.
More Information.
The select() call might return 2. That means two bits are set in total
in the sets used. As there is only one fd it means that the fd both has
data and an error.
This happens when the last data is received and the peer has notified
that it won't send any more data.
If this happens one should use the information in the readset first
before handling any exceptions.
This caused the http_client to fail at the last packet depending on the
timing.
Change this so that it only considers the errorset if it's only one bit
set in the returned sets.
The text was updated successfully, but these errors were encountered: