Giter Site home page Giter Site logo

couchbase / cbgt Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 12.0 16.88 MB

The cbgt project provides a generic golang library that manages partitions or data shards across a cluster of servers.

License: Other

Makefile 0.02% Go 97.92% CSS 0.08% HTML 0.65% JavaScript 1.33%

cbgt's People

Contributors

abhinavdangeti avatar adamcfraser avatar avsej avatar boparai11 avatar bryandmc avatar cascadingradium avatar ceejatec avatar hisundar avatar ingenthr avatar jamesl33 avatar likith101 avatar metonymic-smokey avatar mikewied avatar moshaad7 avatar mschoch avatar pavel-blagodov avatar sreekanth-cb avatar steveyen avatar thejas-bhat avatar tleyden avatar udkyo avatar zgramana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cbgt's Issues

Panic when PIndexImplType New function returns nil Dest, nil error

I think that the RegisterPIndexImplType.New function that is passed to CBGT:

cbgt.RegisterPIndexImplType(base.IndexTypeSyncGateway, &cbgt.PIndexImplType{
        New: <--

is returning nil, and it's causing CBGT to panic. I think in general, libraries shouldn't panic .. I guess maybe we could provide an OnError callback function or something instead?

015-12-17T14:48:25.672-08:00 WARNING: Could not find database for bucket name: bucket-1.  Unable to instantiate this pindex from disk. -- rest.(*ServerContext).SyncGatewayPIndexFactoryCommon() at server_context.go:185
2015/12/17 14:48:25 manager: loading dataDir... done
2015/12/17 14:48:25 planner: awakes, reason: start
2015/12/17 14:48:25 janitor: awakes, reason: start
2015/12/17 14:48:25 janitor: pindexes to remove: 0
2015/12/17 14:48:25 janitor: pindexes to add: 0
2015/12/17 14:48:25 janitor: feeds to remove: 0
2015/12/17 14:48:25 janitor: feeds to add: 1
2015/12/17 14:48:25   bucket-17732d5ba13e3a6f221f7d00f3e8c6234_2ff2a92097a52ba3
2015/12/17 14:48:25 feed_dcp: start, name: bucket-17732d5ba13e3a6f221f7d00f3e8c6234_2ff2a92097a52ba3
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x48 pc=0x41bdb3e]

goroutine 81 [running]:
github.com/couchbase/cbgt.(*DCPFeed).GetMetaData.func1(0x0, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/feed_dcp.go:477 +0x12e
github.com/couchbase/cbgt.Timer.func1()
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/misc.go:234 +0x25
github.com/rcrowley/go-metrics.(*StandardTimer).Time(0xc8206224e0, 0xc8203ea960)
    /Users/tleyden/Development/sync_gateway/src/github.com/rcrowley/go-metrics/timer.go:212 +0x3d
github.com/couchbase/cbgt.Timer(0xc8204083f0, 0x5640b28, 0xc8206224e0, 0x0, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/misc.go:235 +0xa7
github.com/couchbase/cbgt.(*DCPFeed).GetMetaData(0xc820604c30, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/feed_dcp.go:480 +0x123
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).getVBucketMetaData(0xc820375680, 0x20, 0x60, 0x486e340, 0x0, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1235 +0xa2
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).sendStreamReq(0xc820375680, 0xc8203b0ae0, 0x20, 0x0, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1275 +0x53
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).refreshWorker(0xc820375680, 0xc8203b0ae0, 0xc820408180, 0xc8200b8400, 0x40, 0x40, 0x0, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1011 +0x84e
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).worker(0xc820375680, 0xc8203ce6c0, 0xf, 0xc82014f860, 0x0)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:957 +0x11ea
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).workerStart.func1.1(0x2)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:681 +0x48
github.com/couchbase/go-couchbase/cbdatasource.ExponentialBackoffLoop(0xc820150e10, 0x23, 0xc820289f38, 0x64, 0x3fc00000, 0x4e20)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1518 +0x2b
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).workerStart.func1(0xc820375680, 0xc8203ce6c0, 0xf, 0xc82014f860, 0x64, 0xc83fc00000, 0x4e20)
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:682 +0x112
created by github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).workerStart
    /Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:685 +0xb7

Noticed this during some experimentation trying to fix couchbase/sync_gateway#1299

Content-type is not application/json for cbgt diagnostics

It's returning text/plain:

> GET /_cbgt/api/diag HTTP/1.1
> Host: ec2-54-161-145-152.compute-1.amazonaws.com:4985
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 07 Jan 2016 01:36:35 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
<
{"/api/cfg":{"status":"ok","indexDefs":{"uuid":"20de9a85a0811c01","indexDefs":{"data-bucketab8b6cc0794c1bb43b76e027271aff8b":{"type":"sync_gateway","name":"data-bucketab8b6cc0794c1bb43b76e027271aff8b","uuid":"20de9a85a0811c01","params":"{\"bucket_name\":\"data-bucket\"}","sourceType":"couchbase","sourceName
...

whereas the cfg endpoint returns application/json:

> GET /_cbgt/api/cfg HTTP/1.1
> Host: ec2-54-161-145-152.compute-1.amazonaws.com:4985
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Content-Type: application/json
< Date: Thu, 07 Jan 2016 01:37:09 GMT
< Transfer-Encoding: chunked
<
{"status":"ok","indexDefs":{"uu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.