Code Monkey home page Code Monkey logo

Comments (5)

phax avatar phax commented on June 11, 2024

And if you don't run in an OOM, you will sooner or later run in an StackOverflowException.
What I could do, is to create an "AsyncMessageProcessor" that handles the messages asynchronously (so dispatching happens in a separate thread). This would avoid the stack overflow and the OOM because the stack would always be fixed sized.
I would do this for the current HEAD which targets JDK 8. Does that sound reasonable to you?

from as2-lib.

undernorthernsky avatar undernorthernsky commented on June 11, 2024

Yes, switching to async would certainly solve the issue.
Though that would require some kind of persistence to avoid dropping messages when the application shuts down? Which effectively duplicates DirectoryResender?

I am not sure if this issue is really relevant for most users; the core problem is "sync" resending, which might be an edge case.

The way we are currently using the lib requires sync (re-)sending; so for the moment we are going forward with the modified MessageProcessor.

So maybe you don't need to "fix" anything; possibly document the problem w.r.t. ImmediateResender (or even deprecate it).
I mainly wanted some feedback, feel free to close as wontfix :-)

from as2-lib.

phax avatar phax commented on June 11, 2024

Well, I don't think it requires a persistence.
If you're currently shutting down your application and there is something to resend, it might also be lost (e.g. when run in a daemon thread).

If there is an async message processor it simply avoids stacking the stacktraces but it also does not throw the exceptions directly. You may wanna have a look at the AsyncMessageProcessor class I just committed.

from as2-lib.

undernorthernsky avatar undernorthernsky commented on June 11, 2024

I'll play with it next week. Just from reading there seem to be a few problems:

  • impossible to detect failure of a specific message? the exception callback only signals that something failed, but neither whether this is the "last" failure (no more retries) nor which message.
  • does that really "resend"? if executeAction in the Runnable fails once, isn't that entry gone from the queue?

In my mind pushing mutable object (aMsg, aOptions) to another thread and returning early is questionable; for example calling aMsg.getMDN() after sending won't work reliably even for sync MDNs.

from as2-lib.

stale avatar stale commented on June 11, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from as2-lib.

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.