mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-21 18:05:30 -04:00
TCP message blocking issue #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Exhen on GitHub (Apr 15, 2025).
Encountered a TCP message blocking issue while debugging the plugin. Interestingly, this issue only occurs during local plugin debugging. For example, when debugging the following code, message 1 can be returned normally, but message 2 gets blocked.
Code example:
here's a working fix for me (generated by Cursor)
@dooonabe commented on GitHub (Apr 21, 2025):
thanks, it's work for me too!!! ps:add self.last_send_time = 0 in TCPReaderWriter init function
@dooonabe commented on GitHub (Apr 21, 2025):
and i find the blocking reason: _recv_from_sock contains lock because this error from debug.dify.ai:5003

but why?
@Exhen commented on GitHub (Apr 21, 2025):
something with sync/async methods I guess?
@LeeeeeeM commented on GitHub (Apr 25, 2025):
I met this problem also.
https://github.com/langgenius/dify/issues/18729
@zengruizhao commented on GitHub (Apr 29, 2025):
Yes, I think the lock should not be added here. After adding the lock, the lock is always acquired by receive, and send cannot acquire the lock.
@zengruizhao commented on GitHub (Apr 30, 2025):
This problem was found on Windows, but not on Linux. The reason for the problem is whether the socket is blocked. After using gevent, it was changed to non-blocking mode, but it does not work on Windows.
In Windows, as long as the socket is readable once, it will be readable afterwards, so it will inevitably block at the subsequent socket.recv,while Linux will make a judgment every time.