Git Product home page Git Product logo

Comments (12)

ThunderHeavyIndustries avatar ThunderHeavyIndustries commented on September 21, 2024 1

ah cool ok I'll test it on monday, thanks again!

from bolt_sips.

ThunderHeavyIndustries avatar ThunderHeavyIndustries commented on September 21, 2024 1

Yes indeed updating does seem to respect the timeout when the query is run as presented, with one caveat!

This still seems to be dying with the longer than 15000ms error message when passed as such:

  def execute(query) do
    Bolt.Sips.transaction(conn(), fn con ->
      Bolt.Sips.query!(con, query)
    end)
  end

or

  def execute(query) do
    Bolt.Sips.transaction(conn(), fn con ->
      Bolt.Sips.query!(con, query, %{}, timeout: 30_000)
    end)
  end

but this does respect the timeout whether set from the config, or passed in the params

  def execute(query) do
      # :timeout set in config
      Bolt.Sips.query!(conn(), query, %{})
  end

or

  def execute(query) do
    Bolt.Sips.query!(conn(), query, %{}, timeout: 30_000)
  end

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on September 21, 2024 1

Oh that's interesting, thank you for such a thorough investigation and for the examples. I'm going to look into the transaction next, in case it is related, and will report back my findings. Many thanks again!

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on September 21, 2024

@ThunderHeavyIndustries - can you please use the latest published release and let us know if the problem is fixed?! Thank you

from bolt_sips.

ThunderHeavyIndustries avatar ThunderHeavyIndustries commented on September 21, 2024

Sure thing, I'll give it a go next week and get back to you.

from bolt_sips.

ThunderHeavyIndustries avatar ThunderHeavyIndustries commented on September 21, 2024

Thanks for getting back to me on this! I'm still experiencing the same issue/seeing the same 1500 ms response after updating to 2.0.10.

Maybe there's something on my end? Setup is as above. The function calls look like this:

given a query which is a string (again verified to work in the Neo4j Desktop client)

  def conn() do
    Bolt.Sips.conn()
  end

  def execute(query) do
    Bolt.Sips.transaction(conn(), fn con ->
      Bolt.Sips.query!(con, query)
    end)
  end

I also tried passing the timeout as part of the params

  def execute(query) do
    Bolt.Sips.transaction(conn(), fn con ->
      Bolt.Sips.query!(con, query, %{}, timeout: 60_000)
    end)
  end

Which doesn't change the behavior or the error message either. Thanks again for your help on this!

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on September 21, 2024

yeah I am sorry, it was my fault. It should work now with 2.0.11.

Here's one easy way to test, provided you have the APOC enabled:

{:ok, _neo} = Sips.start_link(url: "bolt://neo4j:test@localhost")
conn = Sips.conn()

Sips.query(conn, "CALL apoc.util.sleep(30000) RETURN 1 as test", %{}, timeout: 35_000)

HTH

from bolt_sips.

ThunderHeavyIndustries avatar ThunderHeavyIndustries commented on September 21, 2024

SO SORRY! Crazy week I'll be checking it out later today!

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on September 21, 2024

No worries, please take your time :)) many thanks

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on September 21, 2024

I see what is going on. When you wrap your queries in transactions, Bolt.Sips delegates the call to the underlining library: DBConnection, including your custom ... options ;)

Please try this instead:

  def execute(query) do
    Bolt.Sips.transaction(conn(), fn con ->
      Bolt.Sips.query!(con, query)
    end, timeout: 30_000)
  end

from bolt_sips.

ThunderHeavyIndustries avatar ThunderHeavyIndustries commented on September 21, 2024

I'll give that a go tomorrow!

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on September 21, 2024

please reopen, in case you find any other related issue. Thanks again!

from bolt_sips.

Related Issues (20)

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.