Comments (5)
This should be fixed in pino-socket, moving it there.
from pino-socket.
Yes it should be ok to emit open multiple times
from pino-socket.
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
from pino-socket.
This should be fixed in pino-socket, moving it there.
I cannot reproduce this issue when using TcpConnection
directly.
Remember to add unit tests.
I can add a unit test to demonstrate that TcpConnection
can reconnect even if the TCP server wasn't available at the start.
from pino-socket.
I think I found two issues!
The first one is that we shouldn't emit an error
on the writable stream when reconnect
is true (because it's a recoverable error). Otherwise, thread-stream will destroy the stream/worker.
The second one is that we do not emit outputStream.emit('open', socket.address())
when we reconnect. If the initial connect
fails then we won't emit open
and as a result we won't receive any data.
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 open
:
pino-socket/lib/TcpConnection.js
Lines 206 to 213 in 7db92b4
Is it OK to emit an open
event every time we connect or reconnect?
from pino-socket.
Related Issues (20)
- Convert test suite to tap
- Support DNS HOT 2
- Syslog Format Support HOT 1
- Is `close` a valid Writable stream option? HOT 3
- Unable to get udp working HOT 1
- Remove pino-abstract-transport and just use a Writable stream
- CLI seems broken HOT 2
- CI is failing HOT 6
- Backoff strategy should be instantiated only once and reset when the connection is established again HOT 2
- [Feature idea] Introduce a FIFO queue with a max size to store data when the TCP socket write is unsuccessful HOT 3
- onSocketClose option cannot be used with ThreadStream (multistream) HOT 5
- Emit a socketClose event instead of defining onSocketClose callback HOT 1
- Allow to configure the backoff strategy using primitive data types HOT 3
- Callback to manipulate the message before send? HOT 1
- Uncaught exception 'send EMSGSIZE' HOT 5
- Package validation and quality checking are failed because of sensitive data (test/certs/server.key) HOT 3
- Data lost on reconnect even with recovery enabled HOT 3
- Unix socket example
- Unix socket example HOT 4
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 pino-socket.