You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/10/20 03:39:39 UTC

[GitHub] [skywalking-php] phanalpha commented on a diff in pull request #24: blocking (channel) sender and PDO exceptions.

phanalpha commented on code in PR #24:
URL: https://github.com/apache/skywalking-php/pull/24#discussion_r1000112320


##########
src/channel.rs:
##########
@@ -33,7 +33,7 @@ static RECEIVER: OnceCell<Mutex<Option<StdUnixStream>>> = OnceCell::new();
 pub fn init_channel() -> anyhow::Result<()> {
     let (sender, receiver) = StdUnixStream::pair()?;
 
-    sender.set_nonblocking(true)?;
+    sender.set_nonblocking(false)?;

Review Comment:
   I agree with the considerations on the main process. As I mentioned, a non-blocking stream fails on `write_all` occasionally (actually, not that occasional). This method (`write_all`) will continuously call `write`, which is not *atomic*. Since we are using a prefix length to serialize and deserialize the data, a `write_all` failure would be unrecoverable (from the stream). IMHO, that is not acceptable either.
   A blocking `sender` is not good, but an option does not help. Why do we communicate via a hand-crafted Unix pipe instead of a Rust native channel?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org