Skip to content
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

WebSocker Server's Connection (fd) Overflow Issue due to continuous increment of Connection Number #5598

Open
mohsin-devdksa opened this issue Nov 29, 2024 · 0 comments

Comments

@mohsin-devdksa
Copy link

Issue Description:

  1. If there are three connections, say, 1, 2 and 3 and if connection number 3 reconnects (disconnects and connects again), then the connection id it receives is 4. So integer 3 is available but not re-assignable to next connections. This behavior will create many gap.

  2. Secondly, $fd (connection id) may have a maximum value that can store in it. We think that a value greater than that max value will lead to "overflow" in $fd.

Is there any work around this risk ? OR, at that point you will want us to restart the WebSocket Server ?

What version of Swoole are you using (show your php --ri swoole)?

Swoole => enabled
Author => Swoole Team <[[email protected]](mailto:[email protected])>
Version => 5.1.2
Built => Aug 15 2024 12:06:11
coroutine => enabled with thread context
debug => enabled
trace_log => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 3.0.2 15 Mar 2022
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
c-ares => 1.18.1
zlib => 1.2.11
brotli => E16777225/D16777225
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled
coroutine_pgsql => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_fiber_mock => Off => Off
swoole.enable_preemptive_scheduler => On => On
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608

What is your machine environment used (show your uname -a & php -v & gcc -v) ?

  • PHP 8.3.12 (cli) (built: Sep 27 2024 03:53:05) (NTS)
  • gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1 22.04)
  • Linux directlv16-ThinkPad-E15-Gen-4 6.8.0-45-generic 45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant