Skip to content

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

Open
@a7g4

Description

@a7g4

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() ||

Activity

dallison

dallison commented on Feb 8, 2024

@dallison
Owner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dallison@a7g4

        Issue actions

          Creating multiple publishers fails if one resizes the channel before the other is created · Issue #19 · dallison/subspace