Giter VIP home page Giter VIP logo

Comments (6)

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Thanks for the patch. I'll look it over this weekend.

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Applying the patch as-is breaks the build for me:

../../../../ext/pg.c:2602:39: error: operator '||' has no right operand
../../../../ext/pg.c: In function ‘pgconn_block’:
../../../../ext/pg.c:2608: error: ‘zerotime’ undeclared (first use in this function)
../../../../ext/pg.c:2608: error: (Each undeclared identifier is reported only once
../../../../ext/pg.c:2608: error: for each function it appears in.)

It's likely just a matter of a missing defined() at line 2602.

I'll fix that and get this applied. Do you have a minimal test case that demonstrates the problem? I can probably figure it out myself, but I'm wondering if it's possible to write a test for it, and thought if you already had something you used, I'd have a headstart.

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Anonymous.


After running into performance problems I found out that the previous patch that added a small wait (1ms) after each PQisBusy is not a good idea. I have committed the next patch:

https://bitbucket.org/rafalbigaj/ruby-pg/changeset/fc4109b2ddba

which uses Winsock events and rb_w32_wait_events.

The proposed solution is faster about 20-30% on WIN32 than the original code.

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Rafał Bigaj (Bitbucket: rafalbigaj, GitHub: rafalbigaj).


I have attached the simple script that I uses to test if the connection problem still exist.

During the script is running I release my network connection. On the original code I frequently encounter hangs.

How to write automated test for it?

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Rafał Bigaj (Bitbucket: rafalbigaj, GitHub: rafalbigaj).


One commit more:
https://bitbucket.org/rafalbigaj/ruby-pg/changeset/2bc78e46c1b6
that fixes memory leaks (forgot to close opened event).

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Fixes #66 Win32 asynchronous queries hang on connection error

from ruby-pg.

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.