Skip to content

Commit

Permalink
Merge pull request #222 from ja8zyjits/random_stuck
Browse files Browse the repository at this point in the history
Random stuck
  • Loading branch information
keis authored Dec 7, 2020
2 parents 5d0bea0 + 217bc0c commit c126757
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 14 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ before_install:
- go get -u github.com/go-playground/overalls
- go get -u github.com/mattn/goveralls
- curl https://bin.equinox.io/a/75VeNN6mcnk/github-com-kevinburke-go-bindata-go-bindata-linux-amd64.tar.gz | tar xfz - -C $GOPATH/bin/
- go get github.com/go-bindata/go-bindata/...
- go get -u github.com/elazarl/go-bindata-assetfs/...
- go get -u github.com/smartystreets/goconvey

Expand Down
9 changes: 8 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ require (
github.com/braintree/manners v0.0.0-20150503212558-0b5e6b2c2843
github.com/davecgh/go-spew v1.1.1
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/gogo/protobuf v0.0.0-20170307180453-100ba4e88506
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/protobuf v0.0.0-20171021043952-1643683e1b54
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v1.4.0
github.com/gorilla/schema v0.0.0-20171101174852-e6c82218a8b3
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff // indirect
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11 // indirect
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb // indirect
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1
github.com/kelseyhightower/envconfig v1.3.0
github.com/kevinburke/go-bindata v3.13.0+incompatible // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/mesos/mesos-go v0.0.0-20170604182343-f2cd423e881b
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v0.8.0
Expand All @@ -28,11 +33,13 @@ require (
github.com/prometheus/procfs v0.0.0-20171017214025-a6e9df898b13
github.com/samuel/go-zookeeper v0.0.0-20171027001500-9a96098268ef
github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/objx v0.1.1
github.com/stretchr/testify v1.2.2
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 // indirect
golang.org/x/sys v0.0.0-20190422165155-953cdadca894
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7
)
22 changes: 22 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/go-bindata/go-bindata v1.0.0 h1:DZ34txDXWn1DyWa+vQf7V9ANc2ILTtrEjtlsdJRF26M=
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
github.com/gogo/protobuf v0.0.0-20170307180453-100ba4e88506 h1:zDlw+wgyXdfkRuvFCdEDUiPLmZp2cvf/dWHazY0a5VM=
github.com/gogo/protobuf v0.0.0-20170307180453-100ba4e88506/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/protobuf v0.0.0-20171021043952-1643683e1b54 h1:nRNJXiJvemchkOTn0V4U11TZkvacB94gTzbTZbSA7Rw=
github.com/golang/protobuf v0.0.0-20171021043952-1643683e1b54/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.4.0 h1:N6R8isjoRv7IcVVlf0cTBbo0UDc9V6ZXWEm0HQoQmLo=
Expand All @@ -24,6 +28,12 @@ github.com/gorilla/schema v0.0.0-20171101174852-e6c82218a8b3 h1:uk5U4PMDBqYjLsxD
github.com/gorilla/schema v0.0.0-20171101174852-e6c82218a8b3/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd h1:9GCSedGjMcLZCrusBZuo4tyKLpKUPenUUqi34AkuFmA=
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd/go.mod h1:TlmyIZDpGmwRoTWiakdr+HA1Tukze6C6XbRVidYq02M=
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff h1:2xRHTvkpJ5zJmglXLRqHiZQNjUoOkhUyhTAhEQvPAWw=
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff/go.mod h1:gJWba/XXGl0UoOmBQKRWCJdHrr3nE0T65t6ioaj3mLI=
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11 h1:BMb8s3ENQLt5ulwVIHVDWFHp8eIXmbfSExkvdn9qMXI=
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11/go.mod h1:+DBdDyfoO2McrOyDemRBq0q9CMEByef7sYl7JH5Q3BI=
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb h1:uSWBjJdMf47kQlXMwWEfmc864bA1wAC+Kl3ApryuG9Y=
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb/go.mod h1:ivcmUvxXWjb27NsPEaiYK7AidlZXS7oQ5PowUS9z3I4=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro=
Expand All @@ -33,10 +43,15 @@ github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa
github.com/kevinburke/go-bindata v3.13.0+incompatible h1:hThDhUBH4KjTyhfXfOgacEPfFBNjltnzl/xzfLfrPoQ=
github.com/kevinburke/go-bindata v3.13.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mesos/mesos-go v0.0.0-20170604182343-f2cd423e881b h1:i8rO8NtmjweQVgRjg3RRGKbDnQoz6UNLWx88oKyYhVs=
github.com/mesos/mesos-go v0.0.0-20170604182343-f2cd423e881b/go.mod h1:kPYCMQ9gsOXVAle1OsoY4I1+9kPu8GHkf88aV59fDr4=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa h1:l8VQbMdmwFH37kOOaWQ/cw24/u8AuBz5lUym13Wcu0Y=
github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand All @@ -58,6 +73,8 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykE
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/objx v0.0.0-20140526180921-cbeaeb16a013/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand All @@ -70,11 +87,16 @@ golang.org/x/net v0.0.0-20171107184841-a337091b0525 h1:KtEW9ll78DlakrUaoIv2p6ooz
golang.org/x/net v0.0.0-20171107184841-a337091b0525/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20171109001538-4b45465282a4/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 h1:TFlARGu6Czu1z7q93HTxcP1P+/ZFC/IKythI5RzrnRg=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 h1:+t9dhfO+GNOIGJof6kPOAenx7YgrZMTdRPV+EsnPabk=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
31 changes: 27 additions & 4 deletions mesos/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"math/rand"
"time"

"github.com/sirupsen/logrus"
"github.com/golang/protobuf/proto"
"github.com/mesos/mesos-go/api/v0/mesosproto"
mesossched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"

"github.com/eremetic-framework/eremetic"
"github.com/eremetic-framework/eremetic/metrics"
Expand Down Expand Up @@ -138,6 +138,7 @@ func (s *Scheduler) Disconnected(mesossched.SchedulerDriver) {
func (s *Scheduler) ResourceOffers(driver mesossched.SchedulerDriver, offers []*mesosproto.Offer) {
logrus.WithField("offers", len(offers)).Debug("Received offers")
var offer *mesosproto.Offer
var offers_updated []*mesosproto.Offer

loop:
for len(offers) > 0 {
Expand All @@ -147,7 +148,19 @@ loop:
break loop
case tid := <-s.tasks:
logrus.WithField("task_id", tid).Debug("Trying to find offer to launch task with")
t, _ := s.database.ReadUnmaskedTask(tid)
t, err := s.database.ReadUnmaskedTask(tid)

if err != nil {
if t.ID == "" {
logrus.WithFields(logrus.Fields{
"task_id_after_ReadUnmaskedTask": t.ID,
"task_id_original": tid,
}).WithError(err).Error("Unable to ReadUnmaskedTask")
metrics.TasksDelayed.Inc()
go func() { s.tasks <- tid }()
break loop
}
}

if t.IsTerminating() {
logrus.Debug("Dropping terminating task.")
Expand All @@ -159,7 +172,7 @@ loop:

continue
}
offer, offers = matchOffer(t, offers)
offer, offers_updated = matchOffer(t, offers)

if offer == nil {
logrus.WithField("task_id", tid).Warn("Unable to find a matching offer")
Expand All @@ -173,12 +186,21 @@ loop:
"task_id": task.TaskId.GetValue(),
"offer_id": offer.Id.GetValue(),
}).Debug("Preparing to launch task")
if task.TaskId.GetValue() == "" {
logrus.WithFields(logrus.Fields{
"task_id_after_createTaskInfo": task.TaskId.GetValue(),
"task_id_original": tid,
}).Error("createTaskInfo failed to create proper TaskId")
metrics.TasksDelayed.Inc()
go func() { s.tasks <- tid }()
break loop
}
t.UpdateStatus(eremetic.Status{
Status: eremetic.TaskStaging,
Time: time.Now().Unix(),
})
s.database.PutTask(&t)
_, err := driver.LaunchTasks([]*mesosproto.OfferID{offer.Id}, []*mesosproto.TaskInfo{task}, defaultFilter)
_, err = driver.LaunchTasks([]*mesosproto.OfferID{offer.Id}, []*mesosproto.TaskInfo{task}, defaultFilter)
if err != nil {
logrus.WithFields(logrus.Fields{
"task_id": task.TaskId.GetValue(),
Expand All @@ -192,6 +214,7 @@ loop:
metrics.TasksLaunched.Inc()
}
metrics.QueueSize.Dec()
offers = offers_updated

continue
default:
Expand Down
56 changes: 49 additions & 7 deletions mesos/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"testing"
"time"

"github.com/sirupsen/logrus"
"github.com/golang/protobuf/proto"
"github.com/mesos/mesos-go/api/v0/mesosproto"
"github.com/sirupsen/logrus"

. "github.com/smartystreets/goconvey/convey"

Expand Down Expand Up @@ -161,6 +161,51 @@ func TestScheduler(t *testing.T) {
So(driver.LaunchTasksFnInvoked, ShouldBeFalse)
})
})
Convey("When a task unable to launch due to zk error and error at ReadUnmaskedTask", func() {
db.DeleteTask(id)
s.tasks <- id
offers := []*mesosproto.Offer{
offer("1234", 1.0, 128, &mesosproto.Unavailability{}),
}
driver.DeclineOfferFn = func(_ *mesosproto.OfferID, _ *mesosproto.Filters) (mesosproto.Status, error) {
return mesosproto.Status_DRIVER_RUNNING, nil
}

s.ResourceOffers(driver, offers)

Convey("The offer should be declined", func() {
So(driver.DeclineOfferFnInvoked, ShouldBeTrue)
})
Convey("The tasks should not be launched", func() {
So(driver.LaunchTasksFnInvoked, ShouldBeFalse)
})
Convey("The tasks should be sent back to channel", func() {
So(<-s.tasks, ShouldNotBeEmpty)
})
})
Convey("When a task unable to launch due to zk error and error at createTaskInfo", func() {
db.DeleteTask(id)
db.PutTask(&eremetic.Task{ID: ""})
s.tasks <- ""
offers := []*mesosproto.Offer{
offer("123444", 1.0, 128, &mesosproto.Unavailability{}),
}
driver.DeclineOfferFn = func(_ *mesosproto.OfferID, _ *mesosproto.Filters) (mesosproto.Status, error) {
return mesosproto.Status_DRIVER_RUNNING, nil
}

s.ResourceOffers(driver, offers)

Convey("The offer should be declined", func() {
So(driver.DeclineOfferFnInvoked, ShouldBeTrue)
})
Convey("The tasks should not be launched", func() {
So(driver.LaunchTasksFnInvoked, ShouldBeFalse)
})
Convey("The tasks should be sent back to channel", func() {
So(len(s.tasks), ShouldNotBeEmpty)
})
})

Convey("When a task is able to launch", func() {
offers := []*mesosproto.Offer{
Expand Down Expand Up @@ -624,8 +669,6 @@ func TestScheduler(t *testing.T) {
})
})



Convey("Schedule task with labels", t, func() {
Convey("Given a scheduler with no scheduled tasks", func() {
scheduler := &Scheduler{
Expand Down Expand Up @@ -671,7 +714,6 @@ func TestScheduler(t *testing.T) {
})
})


Convey("KillTask", t, func() {
driver := mock.NewMesosScheduler()
id := "eremetic-task.9999"
Expand All @@ -686,7 +728,7 @@ func TestScheduler(t *testing.T) {
db.PutTask(&eremetic.Task{
ID: id,
Status: []eremetic.Status{
eremetic.Status{
{
Time: 123456,
Status: eremetic.TaskRunning,
},
Expand All @@ -711,7 +753,7 @@ func TestScheduler(t *testing.T) {
db.PutTask(&eremetic.Task{
ID: id,
Status: []eremetic.Status{
eremetic.Status{
{
Time: 123456,
Status: eremetic.TaskQueued,
},
Expand All @@ -737,7 +779,7 @@ func TestScheduler(t *testing.T) {
db.PutTask(&eremetic.Task{
ID: id,
Status: []eremetic.Status{
eremetic.Status{
{
Time: 123456,
Status: eremetic.TaskLost,
},
Expand Down
10 changes: 8 additions & 2 deletions zk/zookeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"
"time"

"github.com/sirupsen/logrus"
"github.com/samuel/go-zookeeper/zk"
"github.com/sirupsen/logrus"

"github.com/eremetic-framework/eremetic"
)
Expand Down Expand Up @@ -150,7 +150,13 @@ func (z *TaskDB) ReadUnmaskedTask(id string) (eremetic.Task, error) {
path := fmt.Sprintf("%s/%s", z.path, id)

bytes, _, err := z.conn.Get(path)
json.Unmarshal(bytes, &task)
if err != nil {
logrus.WithError(err).Debug("Unable to Get from zk.")
}
uError := json.Unmarshal(bytes, &task)
if uError != nil {
logrus.WithError(uError).Debug(fmt.Sprintf("Unable to Unmarshal %s.", string(bytes)))
}

return task, err

Expand Down

0 comments on commit c126757

Please sign in to comment.