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

nng_stat_find_socket always returns the same stats node #1577

Closed
cadaker opened this issue Apr 14, 2022 · 1 comment
Closed

nng_stat_find_socket always returns the same stats node #1577

cadaker opened this issue Apr 14, 2022 · 1 comment

Comments

@cadaker
Copy link

cadaker commented Apr 14, 2022

Describe the bug
I'm running nng_stat_find_socket on two different sockets, but the same stat node is returned for both.

Expected behavior
Different sockets should have different stats, and nng_stat_find_socket should find the stats for the socket given.

Actual Behavior
It seems like the find call just retrieves the first socket it finds, regardless of the socket passed in.

To Reproduce
This test case fails for me:

    nng_socket s0{};
    nng_socket s1{};
    nng_pub0_open(&s0);
    nng_pub0_open(&s1);

    nng_stat* stats = nullptr;
    nng_stats_get(&stats);
    nng_stat* s0stat = nng_stat_find_socket(stats, s0);
    nng_stat* s1stat = nng_stat_find_socket(stats, s1);
    CHECK(s0stat != s1stat);

Environment Details

  • NNG version: master
  • Operating system and version: Ubuntu 20.04
  • Compiler and language used: g++ 9.4.0
  • Shared or static library: static

Additional context
When looking at the stats dump, all sockets are listed with the header of Socket#0. The "id" node below shows the correct socket id, though. That is maybe relevant information?

@gdamore
Copy link
Contributor

gdamore commented Apr 16, 2022

Ooops.

@gdamore gdamore changed the title nng_stat_find_socket on pub0 socket always returns the same stats node nng_stat_find_socket always returns the same stats node Apr 16, 2022
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

2 participants