Code Monkey home page Code Monkey logo

Comments (8)

haotianw465 avatar haotianw465 commented on July 18, 2024

We will look at this issue as soon as possible. It looks like you patched botocore or boto3 and httplib at the same time correct? If you could share the caller code that will help a lot with the debugging.

from aws-xray-sdk-python.

IlyaSukhanov avatar IlyaSukhanov commented on July 18, 2024

I'm using patch_all() which patches

[INFO]	2018-04-06T00:25:02.442Z	870efd48-3930-11e8-a425-f7be7f28044b	successfully patched module httplib
[INFO]	2018-04-06T00:25:02.443Z	870efd48-3930-11e8-a425-f7be7f28044b	successfully patched module pynamodb
[INFO]	2018-04-06T00:25:02.443Z	870efd48-3930-11e8-a425-f7be7f28044b	successfully patched module requests
[INFO]	2018-04-06T00:25:02.443Z	870efd48-3930-11e8-a425-f7be7f28044b	successfully patched module sqlite3

The caller code is actually not mine, using pandas.read_csv() (https://github.com/pandas-dev/pandas/blob/v0.22.0/pandas/io/parsers.py#L557-L709)

from aws-xray-sdk-python.

haotianw465 avatar haotianw465 commented on July 18, 2024

I see. From the stack trace pandas is depending on botocore to call AWS S3 APIs to retrieve files. botocore has some certain part that depends on httplib. The httplib patcher failed because botocore use it in an unexpected way.

We will release a bug fix. With the fix you will not get this error. But you won't see the http roundtrip time since botocore has custom logic to actually send the http request.

from aws-xray-sdk-python.

IlyaSukhanov avatar IlyaSukhanov commented on July 18, 2024

Thank you @haotianw465, I can reproduce the error quite easily so let me know if you want a patch tested.

from aws-xray-sdk-python.

haotianw465 avatar haotianw465 commented on July 18, 2024

Though I don't know how you are using pandas in your application but I'm fairly confident that if you change this line https://github.com/aws/aws-xray-sdk-python/blob/master/aws_xray_sdk/ext/httplib/patch.py#L106 to the following:

    xray_data = getattr(instance, _XRAY_PROP, None)
    if not xray_data:
        return wrapped(*args, **kwargs)

it should work, assuming you have write access to change this file in place.

from aws-xray-sdk-python.

IlyaSukhanov avatar IlyaSukhanov commented on July 18, 2024

Confirmed that this patch works.

I see that httplib still gets patched:

successfully patched module httplib

But instead of crashing I get the expected warning:

cannot find the current segment/subsegment, please make sure you have a segment open

from aws-xray-sdk-python.

haotianw465 avatar haotianw465 commented on July 18, 2024

Cool. We will roll out this fix in the next release as soon as possible, though we cannot provide an exact date.

In the meantime if your application doesn't have direct dependency on httplib and you don't need to trace those http calls, we would recommend to use patch((my_lib_1, my_lib_2)) to explicit capture the libraries you care about.

from aws-xray-sdk-python.

haotianw465 avatar haotianw465 commented on July 18, 2024

This issue has been fixed in the latest v1.0 release.

from aws-xray-sdk-python.

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.