question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in asynchronous callback

See original GitHub issue

HTTP4S 0.21.2 and 0.21.3 produce the following error (version 0.21.1 does not).

If you git clone this repository, update the build.sbt to use 0.21.2 and then hit sbt run you’ll see the errors on each request:

https://github.com/ljwagerfield/http4s-request-body-error

The error occurs in the background after calling Client[Task].fetch; the resulting Task[A] is not in a failed state, and the application appears to continue running as normal.

This happens on every request (these are a mix of GET, PUT and DELETE).

As mentioned, 0.21.1 is fine (does not exhibit the problem).

[ERROR] org.http4s.client.asynchttpclient.AsyncHttpClient - Error in asynchronous callback
monix.execution.exceptions.CallbackCalledMultipleTimesException: onSuccess
	at monix.eval.internal.TaskCreate$CallbackForCreate.onSuccess(TaskCreate.scala:196)
	at monix.execution.Callback.apply(Callback.scala:105)
	at monix.execution.Callback.apply(Callback.scala:82)
	at org.http4s.client.asynchttpclient.AsyncHttpClient$$anon$1.$anonfun$onCompleted$1(AsyncHttpClient.scala:126)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:81)
	at monix.eval.internal.TaskRunLoop$.$anonfun$restartAsync$1(TaskRunLoop.scala:222)
	at monix.execution.schedulers.TracingRunnable.run(TracingRunnable.scala:33)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1429)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
rossabakercommented, Apr 26, 2020

Excellent. This will be in 0.21.4, which I expect out early this week. Thanks for reporting and testing!

1reaction
rossabakercommented, Apr 26, 2020

Okay, 0.21.3+63-2e9fd3ae-SNAPSHOT tests what I thought we were testing last round.

If that’s still not right, I’ve still got another idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Handle Errors in Asynchronous Javascript Code ...
The first argument of the callback is usually named error, whereby if something goes wrong in the asynchronous function, then the callback ...
Read more >
How to handle errors when dealing with asynchronous code
The first parameter in any callback function is the error object so they are often referred to as error-first callbacks. If there is...
Read more >
Why asynchronous exceptions are uncatchable with callbacks
An asynchronous exception is uncatchable because the intended catch block is not present when the asynchronous callback is executed. Instead, the exception will ......
Read more >
Asynchronous error handling in JavaScript - Ruben Verborgh
Error callbacks. One of the characteristics of asynchronous functions is that they cannot immediately calculate their return value (otherwise, ...
Read more >
How to catch an error on a async callback function on outer try ...
So I am using the puppeteer framework and I have an async function that interact with a webpage. This function clicks and selects...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found