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

Creating multiple publishers fails if one resizes the channel before the other is created #19

Open
a7g4 opened this issue Feb 6, 2024 · 1 comment

Comments

@a7g4
Copy link

a7g4 commented Feb 6, 2024

Example test case:

TEST_F(ClientTest, CreatePublisherAutomaticResizeCreateSecondPublisher) {
  subspace::Client pub_client1;
  subspace::Client pub_client2;
  ASSERT_TRUE(pub_client1.Init(Socket()).ok());
  ASSERT_TRUE(pub_client2.Init(Socket()).ok());

  auto pub_client1_pub = *pub_client1.CreatePublisher("Channel5", 256, 8);
  pub_client1_pub.GetMessageBuffer(500);

  auto pub_client2_pub = *pub_client2.CreatePublisher("Channel5", 256, 8); // This fails
}

Is this expected behaviour?

If not, It looks like after removing the slot size check here everything else seems to still work (after updating the BadPublisherParameters test)

if (channel->SlotSize() != req.slot_size() ||

@dallison
Copy link
Owner

dallison commented Feb 8, 2024

Yeah, this is a bug. It should probably just check the number of slots, since the slot size can be increased. Thanks for the report. I'll implement a fix.

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