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

[BUG] The process will block if close client or producer when pulsar server is down. #1190

Open
asddongmen opened this issue Feb 29, 2024 · 1 comment

Comments

@asddongmen
Copy link

asddongmen commented Feb 29, 2024

Expected behavior

Tell us what should happen

When calling the client or producer close method, it should fail and return.

Actual behavior

Tell us what happens instead

Instead of failing and returning, the close method keeps blocking if the pulsar cluster is down.

Steps to reproduce

How can we reproduce the issue

  1. Deploy a standalone pulsar server.
  2. Connect a go client to the server.
  3. Shut down the server.
  4. Close the client.
  5. Observe that the process blocks.

System configuration

Pulsar version: pulsar-client-go v0.11.0

@asddongmen asddongmen changed the title Pulsar client and producer can not be closed if the Pulsar server is down. The process will block if close client or producer when pulsar server is down. Mar 7, 2024
@asddongmen asddongmen changed the title The process will block if close client or producer when pulsar server is down. [BUG] The process will block if close client or producer when pulsar server is down. Mar 7, 2024
@crossoverJie
Copy link
Contributor

Could you provide your test case? I can't reproduce.

func TestCloseBroker(t *testing.T)  {
	client, err := NewClient(ClientOptions{
		URL: lookupURL,
	})
	assert.Nil(t, err)

	t.Logf("connect success\n")
	time.Sleep(time.Second * 30)
    
	// shutdown broker
	client.Close()
	t.Logf("client close sucess")

}

Buf if you create producer/consumer, the client will try to reconnect, maybe the process is blocked as you described.

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