Skip to content

Conversation

TienHuyIoT
Copy link

  • Avoid self-deadlock by using recursive mutex.
  • Add test case for example ServerSentEvents.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/AsyncEventSource.cpp:405

  • Typographical error: 'insteads' should be corrected to 'instead'.
 * @brief: Fix self-deadlock by using recursive_mutex insteads of mutex.

@mathieucarbou
Copy link
Member

@TienHuyIoT did you look also at the websocket code that is similar ? Maybe the same issue is there ?

@TienHuyIoT
Copy link
Author

@TienHuyIoT did you look also at the websocket code that is similar ? Maybe the same issue is there ?

Yes, they are almost the same.

TienHuyIoT added a commit to TienHuyIoT/ESP32Async-ESPAsyncWebServer that referenced this pull request Apr 12, 2025
- Roll back the example ServerSendEvents.ino to its original.
- Create a new example for the pull request ESP32Async#156
@mathieucarbou
Copy link
Member

@TienHuyIoT did you look also at the websocket code that is similar ? Maybe the same issue is there ?

Yes, they are almost the same.

Do you mind adding a commit for websocket also ?

@TienHuyIoT
Copy link
Author

@TienHuyIoT did you look also at the websocket code that is similar ? Maybe the same issue is there ?

Yes, they are almost the same.

Do you mind adding a commit for websocket also ?

Could you please explain your concern in more detail? I'm willing to help, but I don't fully understand your request.

@mathieucarbou
Copy link
Member

@TienHuyIoT did you look also at the websocket code that is similar ? Maybe the same issue is there ?

Yes, they are almost the same.

Do you mind adding a commit for websocket also ?

Could you please explain your concern in more detail? I'm willing to help, but I don't fully understand your request.

I was asking if the same kind of deadlock could occur in the n websocket code with the use of normal mutexes in in websocket code, and if yes, if you could take the opportunity to also fix the websocket code. But that's just a question - not something you need to do if you do not want to

@TienHuyIoT
Copy link
Author

TienHuyIoT commented Apr 12, 2025

@TienHuyIoT did you look also at the websocket code that is similar ? Maybe the same issue is there ?

Yes, they are almost the same.

Do you mind adding a commit for websocket also ?

Could you please explain your concern in more detail? I'm willing to help, but I don't fully understand your request.

I was asking if the same kind of deadlock could occur in the n websocket code with the use of normal mutexes in in websocket code, and if yes, if you could take the opportunity to also fix the websocket code. But that's just a question - not something you need to do if you do not want to

Thanks for your explanation!
I’ve understood your point. The previous pull request that addressed the WebSocket issue has already resolved the deadlock in the WebSocket client handler by using a standard mutex.
If that was your concern, no further action is needed, as it's already implemented.
However, if I have other findings, I will commit them late.
Please let me know if you have any questions.

@mathieucarbou
Copy link
Member

@TienHuyIoT : thanks a lot!

- Avoid self-deadlock by using recursive mutex.
- Create a new example for the pull request ESP32Async#156
@mathieucarbou
Copy link
Member

I took the liberty to update this PR and rebase it on top of main and fix the websocket commits that were still there due to a missing rebase

@mathieucarbou
Copy link
Member

@me-no-dev @vortigont : this PR is good to go for me. Can you please have a look ?

@mathieucarbou mathieucarbou merged commit 1e2d3d5 into ESP32Async:main Apr 14, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants