[GODRIVER-39] creating a new cluster panics if mongod isn't running Created: 13/Jun/17  Updated: 27/Oct/23  Resolved: 08/Nov/17

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Adinoyi Omuya Assignee: Samuel Rossi (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: GODRIVER Core Specs

 Description   

See:

panic: send on closed channel
goroutine 8 [running]:
github.com/10gen/sqlproxy/vendor/github.com/10gen/mongo-go-driver/cluster.(*Monitor).startMonitoringServer.func1(0xc4201677a0, 0xc420167680)
	/Users/bedrich/gopath/src/github.com/10gen/sqlproxy/vendor/github.com/10gen/mongo-go-driver/cluster/monitor.go:185 +0x92
created by github.com/10gen/sqlproxy/vendor/github.com/10gen/mongo-go-driver/cluster.(*Monitor).startMonitoringServer
	/Users/bedrich/gopath/src/github.com/10gen/sqlproxy/vendor/github.com/10gen/mongo-go-driver/cluster/monitor.go:187 +0x12f

This happens when cluster.New(...) is called with cluster options.



 Comments   
Comment by Samuel Rossi (Inactive) [ 08/Nov/17 ]

I'll close this ticket since we can't reproduce it, although feel free to reopen it if it starts happening again

Comment by Adinoyi Omuya [ 08/Nov/17 ]

Yeah, I tried repro'ing this with the actual calls made within the BI Connector but was unable to. I think it has been fixed somehow. Will get more details if it pops up again, thanks.

Comment by Samuel Rossi (Inactive) [ 07/Nov/17 ]

I ran the following (without a mongod running):

package main
 
import (
	"fmt"
	"github.com/10gen/mongo-go-driver/yamgo/connstring"
	"github.com/10gen/mongo-go-driver/yamgo/private/cluster"
)
 
func main() {
	cs, _ := connstring.Parse("localhost:27017")
	cluster.New(cluster.WithConnString(cs), cluster.WithMode(cluster.AutomaticMode))
 
	fmt.Println("okay")
 
	for {
	}
}

It prints "okay" and then loops without panicking.

Comment by Adinoyi Omuya [ 06/Nov/17 ]

It's been a while and I don't recall any specifics beyond what's here (craiggwilson might). It is possible this has been fixed since I filed the ticket... could you send me your short repro script so I can try on my end?

Comment by Samuel Rossi (Inactive) [ 06/Nov/17 ]

adinoyi.omuya I'm having trouble reproducing this; can you provide a short example Go file I can run that causes this error?

Comment by David Golden [ 16/Aug/17 ]

Generally, drivers don't error if a topology is unavailable, they connect lazily and error later on server selection. The same should probably be true here.

Generated at Thu Feb 08 08:33:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.