Comments (13)
Which error message do you get with that approach?
from byte-stream.
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.
@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.
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.
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.
@amphp/windows-tester Could any of you please run the current master
test suite on Windows and report the results?
from byte-stream.
There were 2 failures:
-
Amp\ByteStream\Test\ResourceOutputStreamTest::testBrokenPipe
Failed asserting that exception of type "Amp\ByteStream\StreamException" is thrown. -
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.
@pcrov Can you try again with the commit I just pushed?
from byte-stream.
There was 1 failure:
- 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.
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.
@pcrov Does it work now?
from byte-stream.
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.
@pcrov Thanks for confirming!
from byte-stream.
Related Issues (20)
- Low bandwidth v2.0.0-beta.13, v2.0.0-beta.14 HOT 10
- Consider avoiding stream_socket_shutdown HOT 3
- Error in Amp\ByteStream\splitLines()
- ReadableStream: Clear data from buffer on read HOT 6
- clarify `getStderr` behaviour when STDERR is not available
- Immediate reads and writes might result in blocking HOT 2
- Modify chunk size on the fly HOT 5
- ResourceOutputStream interrupts writing without consumer giving information what was written/unwritten HOT 11
- Problem writing to stream HOT 6
- InputStreamChain HOT 3
- ResourceOutputStream treats open stream as closed HOT 5
- Can cause infinite loop in caller code HOT 2
- Invalid watcher issue in ResourceInputStream
- LineReader custom delimiter HOT 2
- Ability to read particular length from stream HOT 4
- Assertion fail: Trying to read from a previously fclose()'d resource (Windows) HOT 3
- Add InputStream::close
- Add CancellationToken to InputStream::read
- The url inside the composer.json should be in their secure version? HOT 2
- ReadableResourceStream::read() length should reattempt a read if less data is returned? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byte-stream.