magneticio / vamp

Vamp - canary releasing and autoscaling for microservice systems
http://vamp.io
Apache License 2.0
623 stars 55 forks source link

Follow Mesos 307 redirect to leader #1095

Open harmw opened 6 years ago

harmw commented 6 years ago

Even though the Vamp httpClient is configured to follow redirects, it's not following the Mesos-specific HTTP/307 that redirects to the current cluster leader.

Hm, or is it? https://github.com/magneticio/vamp/commit/1a5b460954e53ac7665879334238eb29033174d9 Not sure if that's the API in use here.

olafmol commented 6 years ago

Can you describe what doesn't work for you, how to reproduce, and what you expect to happen? tnx!

harmw commented 6 years ago

Yeah, totally. So, after starting a deployment I get the following:

[0;39m19:38:58.008 | ERROR | io.vamp.common.http.HttpClient           |                                          | rsp [HttpMethod(GET) http://mesos-master.service.consul:5050/master/slaves] - unexpected status code: 307
19:38:58.009 | WARN  | io.vamp.common.notification.Notification |                                          | No mapping for class io.vamp.container_driver.notification.ContainerResponseError
19:38:58.009 | ERROR | io.vamp.common.notification.Notification |                                          | Notification.
19:38:58.009 | ERROR | io.vamp.common.notification.Notification |                                          | 
io.vamp.common.http.HttpClientException: 
    at io.vamp.common.http.HttpClient.$anonfun$httpWithEntity$9(HttpClient.scala:157)
    at scala.util.Success.$anonfun$map$1(Try.scala:251)
    at scala.util.Success.map(Try.scala:209)
    at scala.concurrent.Future.$anonfun$map$1(Future.scala:287)
    at akka.http.scaladsl.util.FastFuture$FulfilledFuture.transform(FastFuture.scala:84)
    at scala.concurrent.Future.map(Future.scala:287)
    at scala.concurrent.Future.map$(Future.scala:287)
    at akka.http.scaladsl.util.FastFuture$FulfilledFuture.map(FastFuture.scala:77)
    at io.vamp.common.http.HttpClient.$anonfun$httpWithEntity$3(HttpClient.scala:153)
    at akka.stream.impl.fusing.MapAsync$$anon$24.onPush(Ops.scala:1169)
    at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:747)
    at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:649)
    at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:471)
    at akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:423)
    at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:603)
    at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:618)
    at akka.actor.Actor.aroundReceive(Actor.scala:496)
    at akka.actor.Actor.aroundReceive$(Actor.scala:494)
    at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:529)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
    at akka.actor.ActorCell.invoke(ActorCell.scala:495)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
    at akka.dispatch.Mailbox.run(Mailbox.scala:224)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

The Consul service catalog has 3 entries for mesos-master (being returned using round-robin), on which we have both Mesos and Marathon.

Here's the output from Mesos, using curl:

> GET /master/slaves HTTP/1.1
> Host: mesos-master.play.ground.dev.blaze.ps:5050
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 307 Temporary Redirect
< Date: Fri, 09 Mar 2018 19:45:45 GMT
< Location: //mesos-master-i-09920357e84d43b91.play.ground.dev.blaze.ps:5050/master/slaves
< Content-Length: 0
<