-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logs are not sent if the TCP server wasn't available when the logger was initialized #73
Comments
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
This should be fixed in pino-socket, moving it there. |
I cannot reproduce this issue when using
I can add a unit test to demonstrate that |
… wasn't available at first
I think I found two issues! The first one is that we shouldn't emit an The second one is that we do not emit Here's the initial connect: pino-socket/lib/TcpConnection.js Lines 198 to 200 in 7db92b4
And here's the reconnect where we do not emit pino-socket/lib/TcpConnection.js Lines 206 to 213 in 7db92b4
Is it OK to emit an |
Yes it should be ok to emit open multiple times |
… wasn't available at first
It seems that
pino-socket
can reconnect to a TCP server (using thereconnect
option) but if the TCP server wasn't available when the logger (multistream?) was initialized then the server won't receive any data.I've created a simple reproduction case because it's hard to explain but relatively straightforward to reproduce: https://github.com/Mogztter/pino-socket-reconnect
My observations:
pino-socket
successfully reconnect (connect) to the TCP server and stops sendingconnect ECONNREFUSED 127.0.0.1:13370
as soon as the server is startedstream.write(data)
inmultistream
is calledThreadStream.write
is called butwriteSync
is not, we keep callingnextFlush
write
function defined on theoutputStream
inTcpConnection
is not calledHopefully, I didn't miss something obvious 😅
The text was updated successfully, but these errors were encountered: