Code Monkey home page Code Monkey logo

Comments (3)

rwnx avatar rwnx commented on August 24, 2024 1

https://github.com/rwnx/pynonymizer/blob/main/pynonymizer/database/mysql/execution.py#L61C27-L61C32

I suspect it's the use of Popen here that means we dont get automatic throwing on bad exit code. this should be reasonably simple to fix (if returncode > 0 raise Error).

According to this https://stackoverflow.com/questions/5631624/how-to-get-exit-code-when-using-python-subprocess-communicate-method

we could do this with .call or switch the whole thing to subprocess.run, which might be more worthwhile in the long run.

postgres will also likely have the same issue.

I think your use case is a little strange and I dont normally expect the db to crash. Let's schedule this for the next minor version.

from pynonymizer.

simonblake-mp avatar simonblake-mp commented on August 24, 2024

I 100% agree that my use case is strange and I'd personally far prefer my DB didn't crash sporadically! That said, there's many more prosaic reasons a long running process like mysqldump could fail mid flight (eg a network or firewalling failure), so it is reasonable to expect other users may be affected.

In addition to a non-zero return code, mysqldump also writes a more informative message to stderr - it may be be worthwhile trapping and returning that as well?

from pynonymizer.

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.