Giter Site home page Giter Site logo

Comments (5)

pivanof avatar pivanof commented on June 24, 2024

Can you give more information on the problem you see and why you are offering to add sleeping to the client code?

from webscalesql-5.6.

wjywbs avatar wjywbs commented on June 24, 2024

This only affects Mac but not Linux. It looks like the packet is not available yet before the sleep. If the sleep is removed, read_change_user_result() will return packet_error and the script will fail to connect to the mysql server with error `Lost connection to MySQL server at 'reading authorization packet', system error: 35.

Adding a sleep is only a temporary fix. A more stable fix is needed for this issue.

https://github.com/webscalesql/webscalesql-5.6/blob/edad0400107c2839ab554af5d7ff3b34217f0bb9/sql-common/client.c#L3823

from webscalesql-5.6.

wake-up-neo avatar wake-up-neo commented on June 24, 2024

The same issue on OSX for mysql/mysqli. PDO connects normally.

from webscalesql-5.6.

jwatzman avatar jwatzman commented on June 24, 2024

The source of the bad read and error ultimately comes from here: https://github.com/webscalesql/webscalesql-5.6/blob/75b113fadf6dc9aabfedad559fec7181f03e7ad2/vio/viosocket.c#L125-L131

That block was added as part of the async mysql diff, and doesn't exist upstream. It also looks very wrong to me. My understanding of the surrounding loop is that it attempts to read from a socket, maybe getting some data, and then waiting until more data is available. This process seems like it should be the same whether the socket is blocking or not (and HHVM tends to have nonblocking sockets here, since it sets timeouts in the mysql/mysqli extensions, which cause webscalesql to mark the socket as nonblocking, since the timeout logic is done in vio_socket_io_wait I think). In particular, nonblocking sockets seem more likely to not have data available and need to go into vio_socket_io_wait.

But it's unclear why this seems to mostly (only?) affect OS X...

In any event, that block looks wrong, should it be removed? cc @steaphangreene who wrote it, @chipturner and @darnaut who had some discussion about a close bit of code in viosocket.c on https://reviews.facebook.net/D17031

from webscalesql-5.6.

jwatzman avatar jwatzman commented on June 24, 2024

Just proposed https://reviews.facebook.net/D46023 to fix this.

from webscalesql-5.6.

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.