-
Notifications
You must be signed in to change notification settings - Fork 644
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
SSE retry loop when event lines breach 4096 chars #1183
Comments
OK, this document contains lines that exceed 4096 characters. I do not yet know if that breaches the SSE spec, but regardless the Akka client should show some indication of failure rather than retry forever. |
EventStreamUnmarshalling docs state that max line length can be overridden. However, Alpakka SSE does not expose access to this. |
Synesso
added a commit
to Synesso/alpakka
that referenced
this issue
Sep 3, 2018
Synesso
changed the title
SSE failure to fetch new events
SSE retry loop when event lines breach 4096 chars
Sep 4, 2018
The fix is pending in the akka-http repo: akka/akka-http#2193 |
ennru
added a commit
that referenced
this issue
Jun 20, 2019
* Versions for Scala 2.13.0 * SSE: Akka HTTP change, make actor system available to reach settings #1183
cheleb
pushed a commit
to cheleb/alpakka
that referenced
this issue
Jul 5, 2019
* Versions for Scala 2.13.0 * SSE: Akka HTTP change, make actor system available to reach settings akka#1183
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edit:
There are two parts to this.
https://github.com/Synesso/alpakka-sse-possible-bug is an MVCE for this bug.
The logic:
There are several subdomains and SSE endpoints under stellar.org. Data is parsed by the SSE adaptor until eventually the component gets into a loop where no more events are found. It seems that the http request headers are correct, but no events are parsed.
Streams that start from the most recent event will run for anywhere up to 10 or 100 events before they meet an event that begins the no-more-events loop. That is to say, 1 event in ~10 to 100 will trigger this bug.
For any given starting event, the results are deterministic. The MVCE shows the bug starting from one of the events that is not processed (id
85025096736968704
).Debugging showed that the failed event was received in
akka.http.scaladsl.unmarshalling.sse.LineParser
, but I was not able to trace it through to understand why it did not eventuate in a parsed event.curl -H "Accept: text/event-stream" -H "Last-Event-ID: 85025096736968704" "https://horizon.stellar.org/transactions"
shows that there is seemingly valid data from this event.The same event is parsed by the utility at https://www.stellar.org/laboratory/#explorer?resource=transactions&endpoint=all&values=eyJjdXJzb3IiOiI4NTAyNTA5NjczNjk2ODcwNCIsInN0cmVhbWluZyI6dHJ1ZX0%3D&network=public . This page demonstrates a javascript SSE library parsing the events correctly.
The output of the MVCE shows only the
open
response is received:By changing the started event to
85025092442066944
(three events prior), the output shows that the three preceding events are parsed, but it then ceases at the troublesome event.The text was updated successfully, but these errors were encountered: