Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Stefan Dietiker
    @d-s-d
    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
    btw, I started the release of 0.8.2
    I tried to update the finagle version but it breakes with the latest version.
    Leon Maia
    @leonmaia
    I'll try to work on this as soon as I can, I changed jobs recently and free time is not something that you actually have during the first 100 days :D
    Leon Maia
    @leonmaia
    Release 0.8.2 out, with both the SSL session fix and the name resolution fix.
    Ben Spencer
    @dangerousben
    is RowDecoder ever intended to be implemented manually or should you just not use queryAs if you want custom decoding?
    re: case classes per tag, is that actually a benefit though? I suppose I can envision some future use for metrics purposes or something but for now it just seems to be boilerplate
    Leon Maia
    @leonmaia
    In my understanding now it just seems "boilerplate", I guess it adds a little bit of more clarity 🙂, but probably removing it makes the code more simple to read though.
    Ben Spencer
    @dangerousben
    wrt RowDecoder, the fact that queryAs is declared as queryAs[T <: Product] leads me to suspect that it was only ever intended to be used with auto derivation from case classes
    we were going to write a custom RowDecoder for a trait that picked the correct subclass based on the data, but it's not really any different to writing a reusable Row => T function to pass to prepareAndQuery
    @leonmaia I was more concerned with ease of adding support for new tags than readability
    currently you have to touch three places in the code like this: finagle/finagle-postgres@dbdb5fa
    jeremyrsmith
    @jeremyrsmith
    @dangerousben IIRC I think RowDecoder was intended to support auto-derivation… but it’s possible there could be APIs for manually constructing it that are easier than dealing with Row directly
    i.e. with lens-ish things and scodec-type combinators
    Ben Spencer
    @dangerousben
    what's supposed to happen if a ValueDecoder throws an exception?
    from the code it looks rather like it will silently return null :|
    jeremyrsmith
    @jeremyrsmith
    ValueDecoder returns a Try… IIRC there are places where the error is silently discarded (and you get null or 0) but there should be parallel APIs that give you the Try. My fault, sorry – maybe it should throw there, but it would have been a pretty big behavior change I think
    i.e. https://github.com/finagle/finagle-postgres/blob/master/src/main/scala/com/twitter/finagle/postgres/Responses.scala#L84 (there is a doc comment not to use it if you care about keeping failures… not really good enough I know, but I didn’t want to introduce exception-throwing behavior into existing Row APIs)
    Ben Spencer
    @dangerousben
    does anyone know what might cause this:
    WARNING: channelOpen() called when channel was already open, clobbering an existing timer
    Ben Spencer
    @dangerousben
    hmm might be because my integration tests are creating multiple clients with the same details and not cleaning them up
    Stefan Dietiker
    @d-s-d
    If I await the result of a Future (e.g., Await.result(future, Duration(10, TimeUnit.SECONDS))) and run into a time-out, is the underlying database-transaction aborted?
    Ben Spencer
    @dangerousben
    I think probably not, but I'd test it to be sure
    jilen
    @jilen
    Is finagle postgres still maintained ?
    Vladimir Kostyukov
    @vkostyukov
    @jilen Yea, @leonmaia is the current maintainer. @jeremyrsmith (previous maintainer) and myself contribute ocasionally.
    Leon Maia
    @leonmaia
    Master build green again... for some reason travis failed to build when I merged the lib upgrades, but now it's all green again :green_apple:
    Ben Spencer
    @dangerousben
    any plans for a release in the near future? would quite like to upgrade to finagle 19.1.0
    Leon Maia
    @leonmaia
    I'll do one today :+1:
    Ben Spencer
    @dangerousben
    nice one, thanks :)
    Leon Maia
    @leonmaia
    0.8.3 should be live soon @dangerousben , couldn't do it yesterday my wife wouldn't let me open my computer during valentines :laughing:
    Ben Spencer
    @dangerousben
    haha :)