Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    jeremyrsmith
    @jeremyrsmith
    Hmm. Thinking about it more, that shouldn’t result in a hang though. It should result in a failure when you query
    André Gonçalves
    @andrerigon
    Yep.
    It fails inside the netty transport. I'll get the stack trace again.
    Leon Maia
    @leonmaia
    In any case, let’s open the issue as a known bug. It was a crazy day debugging jvm properties and reading finagle code :D
    jeremyrsmith
    @jeremyrsmith
    ah, you are getting a failure when you go to query
    so we need to disallow failure of the typeMap future. The question is, retry forever or raise an exception and make the user deal with it?
    Leon Maia
    @leonmaia
    how the user would deal with it?
    I don’t see how, unless he recreates the client.
    jeremyrsmith
    @jeremyrsmith
    well, look at it this way - let’s say the server would be down for 3 days. Should the client sit around for 3 days waiting for it to come back up, or should your application have an error so you know what’s up?
    Leon Maia
    @leonmaia

    Yeah, I understand. But that's the behavior that the Finagle Client has right? I mean, if I correctly understood the client already uses the networkaddress.cache.ttl property. If that's the case I think we should do the same, so we keep the same behavior. But let's discuss more, I'll try tomorrow to take another look at it.

    But, in any case, thanks for the help on fixing the issue, we were completely lost :)

    André Gonçalves
    @andrerigon
    I believe that a client will expect the client to be back once the connection succeeds. It was exactly our case: InetResolver succeed, so we thought the client would be able to connect again.
    Leon Maia
    @leonmaia
    Hey @jeremyrsmith whenever you have some time please take a look at: finagle/finagle-postgres#76.
    This fixes the issue that we experienced, right now we have this version in our project since we use jsonbwhich is not present in the default types. Please leave some feedback :)
    Stefan Dietiker
    @d-s-d
    Hi there. I installed finagle-postgres package as indicated in the user guide. However, com.twitter.finagle.postgres.generic seems to be missing. Was that package removed in the newest release?
    Ben Spencer
    @dangerousben
    finagle-postgres-shapeless is a separate jar
    Stefan Dietiker
    @d-s-d
    @dangerousben Thanks!
    Abraham Fine
    @afine
    Hi everyone. How would I go about getting the equivalent functionality of the "sslrootcert" param in a postgres uri when using finagle-postgres?
    Ben Spencer
    @dangerousben
    is there a reason loggers in StateMachine and elsewhere aren't namespaced?
    eg you get log entries like:
    DEBUG state machine-0 - Transitioning to state 
    com.twitter.finagle.postgres.connection.AuthenticationRequired$ and emiting result
    which are a hassle to filter out in logback
    (also arguably they're noisy enough that they should be at trace level)
    jeremyrsmith
    @jeremyrsmith
    @dangerousben I don’t think there’s a reason. Feel free to change it.
    Ben Spencer
    @dangerousben
    Ben Spencer
    @dangerousben
    I have an issue with exceptions being thrown by SslHandler not being logged
    this is all I see:
    DEBUG c.t.f.p.c.PgClientChannelHandler - Detected channel disconnected!
    DEBUG c.t.f.n.c.ChannelStatsHandler - ChannelStatsHandler caught an exception
    INFO  c.t.finagle - FailureAccrualFactory marking connection to "postgres:master" as dead.
    if I add an exceptionCaught method to PgClientChannelHandler I can log it (it's a cert validation error), but I'm not sure whether that should be the responsibility of something else in the pipeline?
    Stefan Dietiker
    @d-s-d

    If I do something as simple as

    scala> val result = Await.result {c.select("select 1") { r => r.get[Int](0) } }

    in the console, it just hangs (the same is true for some actual queries). What am I doing wrong?

    Vladimir Kostyukov
    @vkostyukov
    @d-s-d This doesn’t look right. How you construct your client?
    Stefan Dietiker
    @d-s-d
    @vkostyukov val c = Postgres.Client().withCredentials("username", Some("password")).database("database").withSessionPool.maxSize(1).withBinaryResults(true).withBinaryParams(true).newRichClient("localhost:5432")
    What's interesting is that if I provoke an error by querying something like select nonexistentfunction(1), I get an exception back. The aforementioned select 1 however (or any other valid statement) hangs.
    Leon Maia
    @leonmaia
    @d-s-d I got to reproduce the same issue as you're having. The insteresting part is that it seems to hang only when using sbt console, since when I created a Main.scala and pasted the same code it worked as supposed.
    Leon Maia
    @leonmaia
    Maybe that's the reason? scala/bug#9076
    Stefan Dietiker
    @d-s-d
    I have a REST-API based on finagle/finch and I use finagle-postgres. So far so good. Now, I need to perform some tasks on a regular base. What I'm currently aiming for is scheduling a task with Java's Timer), and use the postgres-client with Await.result() in a synchronized fashion. The task itself is potentially long-running. Are there any caveats with this approach?
    jeremyrsmith
    @jeremyrsmith
    Finagle really doesn’t want you to block futures. Any particular reason you want to block it?
    Stefan Dietiker
    @d-s-d
    @jeremyrsmith I don't quite understand. What I'm doing is starting a separate Timer-thread that schedules a task on a regular basis. The task is inherently synchronous, so I use Await.result() to wait for the result. It should only block the thread of the Timer, no?
    Leon Maia
    @leonmaia
    @d-s-d I would suggest you to take a look into using a future pool instead, have a look into: https://twitter.github.io/finagle/guide/Futures.html#blocking-or-synchronous-work you can combine it with fx an Executor service, either that or take a quick look on the Akka scheduler it's also pretty easy to create what you're trying to achieve.
    Leon Maia
    @leonmaia
    Hi folks, I finished releasing the version 0.8.0. 🎉
    Ben Spencer
    @dangerousben
    :thumbsup:
    Ben Spencer
    @dangerousben
    @leonmaia did finagle-postgres-shapeless get released?
    Leon Maia
    @leonmaia
    no, I forgot about it. I can do in an hour or so.
    I'm also planning to create a document with the steps to do the release. I found myself googling and looking into DMs today to remember what I should do, since I'm not using the same macbook as the first time that I did the release :D
    Ben Spencer
    @dangerousben
    thanks
    Leon Maia
    @leonmaia
    @dangerousben finagle-postgres-shapeless 0.8.0 is published.
    Ben Spencer
    @dangerousben
    cheers :)
    Ben Spencer
    @dangerousben
    although it hasn't appeared on maven central yet, maybe there's a lag...
    Leon Maia
    @leonmaia
    yeah, should be there soon.
    Ben Spencer
    @dangerousben
    I'm thinking maybe we don't need a 1:1 mapping between CommandCompleteStatuss and actual postgres responses