Code Monkey home page Code Monkey logo

Comments (10)

shazow avatar shazow commented on July 22, 2024

Ah, thank you for the excellent bug report and analysis. I believe you're correct.

Is this something you may be interested in fixing and sending a pull request? Otherwise I'll take a look at it in the next week or two.

from urllib3.

thatguystone avatar thatguystone commented on July 22, 2024

I was looking at trying to fix it, but I didn't just want to go in and change stuff while breaking everything. If you're okay reviewing any changes I make to make sure they're not going to mess everything up, I'd be more than happy to give it a shot.

from urllib3.

shazow avatar shazow commented on July 22, 2024

Absolutely.

Since we suspect the bug is simply the way the queue gets populated, we should be able to start with a simple unit test illustrating the bug. Have a look at some of these for example: https://github.com/shazow/urllib3/blob/master/test/test_connectionpool.py

urllib3 should be very thoroughly tested so hopefully we won't need to worry about breakage too much. :)

from urllib3.

thatguystone avatar thatguystone commented on July 22, 2024

@shazow: Could you run your tests of 358c789? I'm seeing the following failures. Just want to make sure I'm not missing something.

(ve)andi@Apollo:~/Dev/IHR/urllib3$ pip freeze
argparse==1.2.1
coverage==3.5.2
distribute==0.6.24
nose==1.1.2
tornado==2.3
wsgiref==0.1.2
(ve)andi@Apollo:~/Dev/IHR/urllib3$ nosetests
.........................F.F..................................
======================================================================
FAIL: test_cross_host_redirect (test.with_dummyserver.test_poolmanager.TestPoolManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andi/Dev/IHR/urllib3/test/with_dummyserver/test_poolmanager.py", line 36, in test_cross_host_redirect
    self.fail("Request succeeded instead of raising an exception like it should.")
AssertionError: Request succeeded instead of raising an exception like it should.
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
root: INFO: 200 GET http://localhost:18081/redirect?target=http%3A%2F%2F127.0.0.1%3A18081%2Fecho%3Fa%3Db (127.0.0.1) 1.38ms
urllib3.connectionpool: DEBUG: "GET http://localhost:18081/redirect?target=http%3A%2F%2F127.0.0.1%3A18081%2Fecho%3Fa%3Db ('HTTP/1.1',)" 200 13
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_redirect (test.with_dummyserver.test_poolmanager.TestPoolManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andi/Dev/IHR/urllib3/test/with_dummyserver/test_poolmanager.py", line 20, in test_redirect
    self.assertEqual(r.status, 303)
AssertionError: 200 != 303
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
root: INFO: 200 GET http://localhost:18081/redirect?target=http%3A%2F%2Flocalhost%3A18081%2F (127.0.0.1) 0.76ms
urllib3.connectionpool: DEBUG: "GET http://localhost:18081/redirect?target=http%3A%2F%2Flocalhost%3A18081%2F ('HTTP/1.1',)" 200 13
--------------------- >> end captured logging << ---------------------

Name                     Stmts   Miss  Cover   Missing
------------------------------------------------------
urllib3                     16      0   100%   
urllib3._collections        69      0   100%   
urllib3.connectionpool     152      7    95%   38, 251, 371-375, 408
urllib3.contrib              0      0   100%   
urllib3.exceptions          24      4    83%   43-47
urllib3.filepost            37      0   100%   
urllib3.poolmanager         48      3    94%   106-108
urllib3.request             23      0   100%   
urllib3.response            80      1    99%   152
urllib3.util                60      0   100%   
------------------------------------------------------
TOTAL                      509     15    97%   
----------------------------------------------------------------------
Ran 62 tests in 0.732s

FAILED (failures=2)

from urllib3.

shazow avatar shazow commented on July 22, 2024

Hmm, passes on Tornado 2.1.1, fails on Tornado 2.3. Wonder what changed.

from urllib3.

thatguystone avatar thatguystone commented on July 22, 2024

Alrighty, 1bbda4e is linked and contains the fixes. If you could review, I would greatly appreciate it.

from urllib3.

shazow avatar shazow commented on July 22, 2024

Took a quick glance, looks good! I'll take a more thorough look this weekend and merge it in. Thanks for doing this, @thatguystone. You're welcome to add yourself to the CONTRIBUTORS.txt if you wish. :)

from urllib3.

adamJLev avatar adamJLev commented on July 22, 2024

+1 please merge fix in. Thanks!

from urllib3.

shazow avatar shazow commented on July 22, 2024

Looks like this has been merged? Hard to tell because it wasn't a real Github pull request. :)

Please reopen if I'm mistaken.

from urllib3.

thatguystone avatar thatguystone commented on July 22, 2024

Just created #86 for this bug. Not sure why I couldn't just make this a pull request :-\

from urllib3.

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.