Giter Club home page Giter Club logo

Comments (7)

prolic avatar prolic commented on May 24, 2024

@enumag this is related: #85

About the connection getting closed: there seems to be a problem with the tcp connection logic, I receive this error as well quite often which is a problem to me. Will need to look further into this, but it's hard to debug, as it happens not regular.

from event-store-client.

enumag avatar enumag commented on May 24, 2024

Maybe we could try debug it with something like phptrace.

Is there a way to work around this for now and reconnect manually? I tried to implement it today but since I can't reproduce the issue reliably I have no way to test if it works.

from event-store-client.

prolic avatar prolic commented on May 24, 2024

from event-store-client.

enumag avatar enumag commented on May 24, 2024

It seems that reconnecting doesn't really help. Or actually it does but it only projects a few events before the connection is closed and then it takes several seconds to reconnect. This is completely useless because I have tens of thousands of events waiting in the queue so with a pause after every few events it will never finish.

Here is something from docker-compose logs. The reason is always the same HEARTBEAT TIMEOUT at msgNum 2:

eventstore_1  | [00001,13,08:37:35.081] Closing connection '"external-normal"":1c6f372d33600741adaf5030299bc0ef"' [172.19.0.5:39810, L172.19.0.2:1113, {831b6de3-e5af-4b05-9a59-cf937a73ed12}] cleanly." Reason: HEARTBEAT TIMEOUT at msgNum 2"
eventstore_1  | [00001,13,08:37:35.081] ES "TcpConnection" closed [08:37:35.082: N172.19.0.5:39810, L172.19.0.2:1113, {831b6de3-e5af-4b05-9a59-cf937a73ed12}]:Received bytes: 121, Sent bytes: 239094
eventstore_1  | [00001,13,08:37:35.081] ES "TcpConnection" closed [08:37:35.083: N172.19.0.5:39810, L172.19.0.2:1113, {831b6de3-e5af-4b05-9a59-cf937a73ed12}]:Send calls: 5, callbacks: 5
eventstore_1  | [00001,13,08:37:35.084] ES "TcpConnection" closed [08:37:35.084: N172.19.0.5:39810, L172.19.0.2:1113, {831b6de3-e5af-4b05-9a59-cf937a73ed12}]:Receive calls: 3, callbacks: 2
eventstore_1  | [00001,13,08:37:35.084] ES "TcpConnection" closed [08:37:35.084: N172.19.0.5:39810, L172.19.0.2:1113, {831b6de3-e5af-4b05-9a59-cf937a73ed12}]:Close reason: [Success] "HEARTBEAT TIMEOUT at msgNum 2"
eventstore_1  | [00001,13,08:37:35.084] Connection '"external-normal"":1c6f372d33600741adaf5030299bc0ef"' [172.19.0.5:39810, {831b6de3-e5af-4b05-9a59-cf937a73ed12}] closed: Success.
eventstore_1  | [00001,46,08:37:35.084] Persistent subscription lost connection from 172.19.0.5:39810
eventstore_1  | [00001,46,08:37:35.084] Retrying message "everything::projection" "everything"/56926
eventstore_1  | [00001,46,08:37:35.084] Retrying message "everything::projection" "everything"/58503
eventstore_1  | [00001,46,08:37:35.084] Retrying message "everything::projection" "everything"/58504

from event-store-client.

enumag avatar enumag commented on May 24, 2024

Do you know what is the heartbeat about? Could some changes to ConnectionSettings::heartbeatInterval() and ConnectionSettings::heartbeatTimeout() fix it?

I found the default values here but I'm not sure what settings I should try. The issue is still not easy to reproduce for me to experiment with it properly.

Btw. the failure seems to always occur right after an event that is somewhat bigger than usual (holds more data inside).

from event-store-client.

enumag avatar enumag commented on May 24, 2024

Hypothesis: Maybe the heartbeat does not occur while I'm processing an event so if the processing of one event takes longer than heartbeatTimeout then the connection is closed.

from event-store-client.

prolic avatar prolic commented on May 24, 2024

Upon further investigation: This is not a bug in the library!

The problem occurs when the server is sending too many data for the client to handle and thus the server decides, the connection is broken, because too much data is piling up.

There are two possible options:

  1. ConnectionPendingSendBytesThreshold is a setting on the server, the default is 10485760. You can increase this number.
  2. Use a smaller batchSize - if you set batchSize to 1000 and have 50KB event size, you reach that pending bytes treshold really fast.

Most of the times, the server is much faster sending data than any php script could handle.

from event-store-client.

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.