Code Monkey home page Code Monkey logo

Comments (12)

ArniDagur avatar ArniDagur commented on September 24, 2024

This is also a problem for python-adblock. Upgrading PyO3 from 0.10 to 0.11 makes the build fail due to thread-safety issues. See https://github.com/ArniDagur/python-adblock/actions/runs/151271594.

from adblock-rust.

antonok-edm avatar antonok-edm commented on September 24, 2024

I don't have a good way to test this, as adblock-rust isn't really used in a multithreaded context in Brave. However, I would be happy to look at PRs for this.

from adblock-rust.

ArniDagur avatar ArniDagur commented on September 24, 2024

It's worth noting that the library used to be thread safe, but this was changed in 19ac71a for apparent performance reasons.

@AndriusA Would you be fine with reverting the aforementioned commit?

from adblock-rust.

ArniDagur avatar ArniDagur commented on September 24, 2024

@antonok-edm What do you think?

from adblock-rust.

antonok-edm avatar antonok-edm commented on September 24, 2024

@ArniDagur it's actually been discussed before - see #101 (comment). Ultimately it seems like the gains from thread-unsafety are more hassle than they're worth, so I would support rolling that change back.

from adblock-rust.

ArniDagur avatar ArniDagur commented on September 24, 2024

I'll make a PR.

EDIT: #130

from adblock-rust.

antonok-edm avatar antonok-edm commented on September 24, 2024

Should be fixed by #130. @wavenator if this doesn't work for you feel free to follow up.

from adblock-rust.

wavenator avatar wavenator commented on September 24, 2024

Thanks a lot for all the effort!

from adblock-rust.

ciokan avatar ciokan commented on September 24, 2024

This package is still not thread safe even with the rollback. Related discussion: https://stackoverflow.com/questions/63761408/rust-rocket-pass-variable-to-endpoints

from adblock-rust.

ArniDagur avatar ArniDagur commented on September 24, 2024

Yeah, you have to disable the object-pooling feature. That worked for me at least. Sorry for the confusion.

from adblock-rust.

ciokan avatar ciokan commented on September 24, 2024

Yeah, you have to disable the object-pooling feature. That worked for me at least. Sorry for the confusion.

Can you tell me how to disable object-pooling? I never touched Rust before and I'm stuck here. Thank you.

from adblock-rust.

antonok-edm avatar antonok-edm commented on September 24, 2024

@ciokan When you add a dependency in your Cargo.toml file, rather than just giving a version number you can specify more information, including a list of "features". Here, you'll also want to disable default features, since object-pooling is on by default. This crate's supported features are all listed under [features] in this repo's Cargo.toml.

In your case you could add a new section that might look something like this:

[dependencies.adblock]
version = "0.3.2"
default-features = false
features = ["full-regex-handling", "embedded-domain-resolver"]

Or if you prefer, you can equivalently specify the whole dependency inline under the usual [dependencies] section like this:

[dependencies]
adblock = { version = "0.3.2", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] }

from adblock-rust.

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.