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

stashed timer messages are discarded #24557

Closed
412b opened this Issue Feb 15, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@412b
Contributor

412b commented Feb 15, 2018

I've recently bumped into a case that messages scheduled with timer and stashed via stash() will be discarded. It comes into play with any class that has StashSupport in the traits.
What happens is:

  1. Timers.aroundReceive calls super.aroundReceive here with unwrapped message.
  2. In case of a call to stash, the message is taken here and it's actorCell.currentMessage, so it's efficiently Envelope with message set to TimerSchedulerImpl.TimerMsg being stashed.
  3. When unstashed the message gets discarded as it was already processed by Timers.

imho, supersedes #24076, because of being a more generic Timers and StashSupport problem.
somewhat related to #24080 as well.

@johanandren johanandren self-assigned this Feb 19, 2018

@johanandren johanandren added 3 - in progress and removed 0 - new labels Feb 19, 2018

johanandren added a commit to johanandren/akka that referenced this issue Feb 19, 2018

johanandren added a commit to johanandren/akka that referenced this issue Feb 19, 2018

@ktoso ktoso closed this in #24565 Feb 20, 2018

@ktoso ktoso added this to the 2.5.10 milestone Feb 20, 2018

@ktoso ktoso removed the 3 - in progress label Feb 20, 2018

ktoso added a commit that referenced this issue Feb 20, 2018

Make stashing timer messages work (#24565)
* Make stashing timer messages work #24557

* Formatting ... ... ...

* Avoid the extra allocation if possible

@ktoso ktoso removed the 3 - in progress label Feb 23, 2018

@antoon-r

This comment has been minimized.

Show comment
Hide comment
@antoon-r

antoon-r Sep 21, 2018

Was it really fixed in 2.5.10?

It is still reproducible with com.typesafe.akka:akka-actor_2.12:2.5.14

Try yourself: https://scastie.scala-lang.org/st73myR1RDipCFiJCdIbfw

Gist: https://gist.github.com/antoon-r/eae5c69715f49254dfbebcff23307577

antoon-r commented Sep 21, 2018

Was it really fixed in 2.5.10?

It is still reproducible with com.typesafe.akka:akka-actor_2.12:2.5.14

Try yourself: https://scastie.scala-lang.org/st73myR1RDipCFiJCdIbfw

Gist: https://gist.github.com/antoon-r/eae5c69715f49254dfbebcff23307577

@johanandren

This comment has been minimized.

Show comment
Hide comment
@johanandren

johanandren Sep 21, 2018

Member

We have test coverage for this issue (

) so pretty sure it was fixed. That's when doing a regular Actor and mixing in timer and stash though.

I wonder if what you are seeing isn't a separate issue with the timers and or stashing in FSM (could you please open up a separate issue for it if so?)

Member

johanandren commented Sep 21, 2018

We have test coverage for this issue (

) so pretty sure it was fixed. That's when doing a regular Actor and mixing in timer and stash though.

I wonder if what you are seeing isn't a separate issue with the timers and or stashing in FSM (could you please open up a separate issue for it if so?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment