You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "YanshuoH (via GitHub)" <gi...@apache.org> on 2023/06/12 03:50:04 UTC

[GitHub] [pulsar-client-go] YanshuoH opened a new issue, #1026: Multiple calls to client.Close causes panic

YanshuoH opened a new issue, #1026:
URL: https://github.com/apache/pulsar-client-go/issues/1026

   #### Expected behavior
   
   Multiple calls to `client.Close` should not cause panic.
   
   #### Actual behavior
   
   Multiple calls to `client.Close` cause panic
   
   #### Steps to reproduce
   
   Create a client and close twice will reproduce the bug.
   
   eg.
   
   ```
   func TestPanic(t *testing.T) {
   	srv := test.GetServerInfo()
   	client, err := pulsar.NewClient(pulsar.ClientOptions{
   		URL:            fmt.Sprintf("pulsar://%s:%s", srv.PulsarTestServerHost, srv.PulsarTestServerTCPPort),
   	})
   	if err != nil {
   		t.Fatal(err)
   	}
   	client.Close()
   	client.Close()
   }
   ```
   
   Output:
   
   ```
   === RUN   TestPanic
   --- FAIL: TestPanic (0.00s)
   panic: close of closed channel [recovered]
   	panic: close of closed channel
   
   goroutine 34 [running]:
   testing.tRunner.func1.2({0x1054d1040, 0x105582c78})
   	/Users/hys/.gvm/gos/go1.19.3/src/testing/testing.go:1396 +0x1c8
   testing.tRunner.func1()
   	/Users/hys/.gvm/gos/go1.19.3/src/testing/testing.go:1399 +0x378
   panic({0x1054d1040, 0x105582c78})
   	/Users/hys/.gvm/gos/go1.19.3/src/runtime/panic.go:884 +0x204
   github.com/apache/pulsar-client-go/pulsar/internal.(*connectionPool).Close(0x14000281080)
   	/Users/hys/.gvm/pkgsets/go1.19.5/global/pkg/mod/github.com/apache/pulsar-client-go@v0.10.0/pulsar/internal/connection_pool.go:128 +0x88
   github.com/apache/pulsar-client-go/pulsar.(*client).Close(0x14000469960)
   	/Users/hys/.gvm/pkgsets/go1.19.5/global/pkg/mod/github.com/apache/pulsar-client-go@v0.10.0/pulsar/client_impl.go:259 +0x40
   go.planetmeican.com/nerds/mq/test/close-panic_test.TestPanic(0x14000292680)
   	/Users/hys/Documents/dev/go-workspace/src/go.planetmeican.com/nerds/mq/test/close-panic/panic_test.go:21 +0x18c
   testing.tRunner(0x14000292680, 0x10557f898)
   	/Users/hys/.gvm/gos/go1.19.3/src/testing/testing.go:1446 +0x10c
   created by testing.(*T).Run
   	/Users/hys/.gvm/gos/go1.19.3/src/testing/testing.go:1493 +0x300
   ```
   
   #### System configuration
   **Pulsar version**: v2.10.3
   **SDK version**: v0.10.0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] tisonkun closed issue #1026: Multiple calls to client.Close causes panic

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun closed issue #1026: Multiple calls to client.Close causes panic
URL: https://github.com/apache/pulsar-client-go/issues/1026


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org