Code Monkey home page Code Monkey logo

Comments (13)

kelunik avatar kelunik commented on May 24, 2024

Which error message do you get with that approach?

from byte-stream.

brstgt avatar brstgt commented on May 24, 2024

Found it. Actually it was an unwanted behaviour in my error handler but this still introduces a possible bug as that code is functionally depending on the return code of a registered error handler.

Fact:
If the registered error handler returns "true" on a suppressed error then ResourceOutputStream will not detect broken pipes. The socket will be writeable forever, never be cancelled and a loop could hang and run with 100% CPU

from byte-stream.

brstgt avatar brstgt commented on May 24, 2024

@kelunik instead of error_get_last the error is simply passed to your temp error handler. You can then handle the error in the same way as you do already

from byte-stream.

kelunik avatar kelunik commented on May 24, 2024

I'm asking because we see behavior with 100% CPU currently if you run something with cluster and add fwrite(STDOUT, "foo"); in the worker, which breaks the IPC channel and makes the parent exit, but the other children will still be alive and 100% CPU then.

from byte-stream.

brstgt avatar brstgt commented on May 24, 2024

Yep, that's probably the same or related issue. Currently the IpcLogger in aerys isn't checking for error_get_last at all - that's why the shutting down WorkerProcess hangs forever if there's sth to log at shutdown. The parent closes the IPC sock earlier and the child always gets EPIPE.

For Ipc a better approach was that the parent doesn't close the socket at all. The child should close it when everything is shut down correctly. The parent should just watch for the closed socket to clean everything.

from byte-stream.

kelunik avatar kelunik commented on May 24, 2024

@amphp/windows-tester Could any of you please run the current master test suite on Windows and report the results?

from byte-stream.

pcrov avatar pcrov commented on May 24, 2024

There were 2 failures:

  1. Amp\ByteStream\Test\ResourceOutputStreamTest::testBrokenPipe
    Failed asserting that exception of type "Amp\ByteStream\StreamException" is thrown.

  2. Amp\ByteStream\Test\ZlibInputStreamTest::testRead
    Failed asserting that two strings are identical.
    --- Expected
    +++ Actual
    @@ @@
    #Warning: Strings contain different line endings!
    -'foobar content
    +'foobar content

from byte-stream.

trowski avatar trowski commented on May 24, 2024

@pcrov Can you try again with the commit I just pushed?

from byte-stream.

pcrov avatar pcrov commented on May 24, 2024

There was 1 failure:

  1. Amp\ByteStream\Test\ZlibInputStreamTest::testRead
    Failed asserting that two strings are identical.
    --- Expected
    +++ Actual
    @@ @@
    #Warning: Strings contain different line endings!
    -'foobar content
    +'foobar content

from byte-stream.

trowski avatar trowski commented on May 24, 2024

Thanks @pcrov, that test probably needs to be fixed on Windows, but that has nothing to do with this issue, so hopefully this has been fixed. I'll wait for @kelunik to confirm before tagging.

from byte-stream.

kelunik avatar kelunik commented on May 24, 2024

@pcrov Does it work now?

from byte-stream.

pcrov avatar pcrov commented on May 24, 2024
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

................................................................. 65 / 70 ( 92%)
.....                                                             70 / 70 (100%)

Time: 1.13 seconds, Memory: 8.00MB

OK (70 tests, 98 assertions)

from byte-stream.

kelunik avatar kelunik commented on May 24, 2024

@pcrov Thanks for confirming!

from byte-stream.

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.