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

Fix: deadlocking when calling close_ns from inside a disconnect_handler #316

Merged
merged 5 commits into from
May 6, 2024

Conversation

Totodore
Copy link
Owner

@Totodore Totodore commented May 6, 2024

Motivation

  • Gracefully close the namespace rather than just removing it. Meaning that the corresponding namespace adapter will be closed as well as all the sockets in the namespace. Their disconnect_handler will be called with a ServerNSDisconnect reason.
  • Fix deadlock when deleting the namespace from inside a disconnect_handler.

Fixes :

@Totodore Totodore added the bug Something isn't working label May 6, 2024
@Totodore Totodore linked an issue May 6, 2024 that may be closed by this pull request
Copy link

github-actions bot commented May 6, 2024

🐰Bencher

ReportMon, May 6, 2024 at 18:27:09 UTC
ProjectSocketioxide
Branchfix-deadlock-close-ns
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

  • Latency (latency)

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns)
engineio_packet/decode/Decode packet binary b64➖ (view plot)84.72
engineio_packet/decode/Decode packet message➖ (view plot)45.88
engineio_packet/decode/Decode packet noop➖ (view plot)35.01
engineio_packet/decode/Decode packet ping/pong➖ (view plot)31.34
engineio_packet/decode/Decode packet ping/pong upgrade➖ (view plot)34.58
engineio_packet/encode/Encode packet binary b64➖ (view plot)56.02
engineio_packet/encode/Encode packet message➖ (view plot)31.21
engineio_packet/encode/Encode packet noop➖ (view plot)30.93
engineio_packet/encode/Encode packet open➖ (view plot)297.48
engineio_packet/encode/Encode packet ping/pong➖ (view plot)30.50
engineio_packet/encode/Encode packet ping/pong upgrade➖ (view plot)30.61
extensions/concurrent_get➖ (view plot)26.36
extensions/concurrent_get_inserts➖ (view plot)30.67
extensions/concurrent_inserts➖ (view plot)22.98
socketio_packet/decode/Decode packet ack on /➖ (view plot)272.25
socketio_packet/decode/Decode packet ack on /custom_nsp➖ (view plot)293.56
socketio_packet/decode/Decode packet binary ack (b64) on /➖ (view plot)508.54
socketio_packet/decode/Decode packet binary ack (b64) on /custom_nsp➖ (view plot)539.50
socketio_packet/decode/Decode packet binary event (b64) on /➖ (view plot)599.58
socketio_packet/decode/Decode packet binary event (b64) on /custom_nsp➖ (view plot)604.70
socketio_packet/decode/Decode packet connect on /➖ (view plot)62.15
socketio_packet/decode/Decode packet connect on /custom_nsp➖ (view plot)76.19
socketio_packet/decode/Decode packet event on /➖ (view plot)363.14
socketio_packet/decode/Decode packet event on /custom_nsp➖ (view plot)385.59
socketio_packet/decode/Decode packet event with ack on /➖ (view plot)364.10
socketio_packet/decode/Decode packet event with ack on /custom_nsp➖ (view plot)385.58
socketio_packet/encode/Encode packet ack on /➖ (view plot)123.61
socketio_packet/encode/Encode packet ack on /custom_nsp➖ (view plot)126.71
socketio_packet/encode/Encode packet binary ack (b64) on /➖ (view plot)308.66
socketio_packet/encode/Encode packet binary ack (b64) on /custom_nsp➖ (view plot)313.00
socketio_packet/encode/Encode packet binary event (b64) on /➖ (view plot)398.79
socketio_packet/encode/Encode packet binary event (b64) on /custom_nsp➖ (view plot)415.46
socketio_packet/encode/Encode packet connect on /➖ (view plot)53.17
socketio_packet/encode/Encode packet connect on /custom_nsp➖ (view plot)55.65
socketio_packet/encode/Encode packet event on /➖ (view plot)127.49
socketio_packet/encode/Encode packet event on /custom_nsp➖ (view plot)131.20
socketio_packet/encode/Encode packet event with ack on /➖ (view plot)127.07
socketio_packet/encode/Encode packet event with ack on /custom_nsp➖ (view plot)130.88

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@Totodore Totodore merged commit 2a2e3b9 into main May 6, 2024
15 checks passed
@Totodore Totodore deleted the fix-deadlock-close-ns branch May 6, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

delete_ns blocks thread indefinitely
1 participant