GithubHelp home page GithubHelp logo

Comments (4)

sc-starman avatar sc-starman commented on May 24, 2024

Upgraded to 8.0.0-rc2 but still got the same problem.
Still, there is no log or evidence that I could use to find out what happened.

from orleans.

ReubenBond avatar ReubenBond commented on May 24, 2024

How are you verifying that the timer is not firing? Could you show the relevant code? When you say that the grain continues to function, I assume this means that there are no logs showing that the grain has been deactivated. Is that correct?

from orleans.

sc-starman avatar sc-starman commented on May 24, 2024

This is the timer function code:

        private async Task PublishOrderbook(object arg)
        {
            if (_orderbookUpdatedTimestamp <= _orderbookSentTimestamp)
            {
                if ((DateTime.UtcNow - _orderbookUpdatedTimestamp).TotalSeconds == 5)
                    _logger.LogCritical("Orderbook not Updated Recently, Pair={Pair}, LastUpdateInSeconds={LastUpdateInSeconds}, Hostname={Hostname}",
                        Pair, (DateTime.UtcNow - _orderbookUpdatedTimestamp).TotalSeconds, Dns.GetHostName());
                return;
            }

            _orderbookSentTimestamp = DateTime.UtcNow;

                    _logger.LogCritical("Orderbook Updated Successfuly, Pair={Pair}, LastUpdateInSeconds={LastUpdateInSeconds}, Hostname={Hostname}",
                        Pair, (DateTime.UtcNow - _orderbookUpdatedTimestamp).TotalSeconds, Dns.GetHostName());


            int count = 40;
            var book = _engine.Book;
            var asks = book.AskSide;
            var bids = book.BidSide;

            _orderBook = new OrderBookStream()
            {
                Pair = Pair,
                Asks = asks.Take(count).ToDictionary(a => (decimal)a.Value.Price, a => (decimal)a.Value.Quantity),
                Bids = bids.Take(count).ToDictionary(a => (decimal)a.Value.Price, a => (decimal)a.Value.Quantity),
                BestAskPrice = book.BestAskPrice,
                BestAskQuantity = book.BestAskQuantity,
                BestBidPrice = book.BestBidPrice,
                BestBidQuantity = book.BestBidQuantity,
                BestStopAskPrice = book.BestStopAskPrice,
                BestStopBidPrice = book.BestStopBidPrice,
                Timestamp = book.LastBookUpdate
            };

            var subject = $"{typeof(OrderBookStream).FullName}_{Pair}";


            await _natsCommand.PublishAsync(subject, _orderBook);
        }

Yeah not only I'm sure the grain is not deactivated (no log) but also I have a grain method that I can query the difference between when the timer fired and how much time passed from the grain activation. Everything seems fine except the timer.

from orleans.

sc-starman avatar sc-starman commented on May 24, 2024

Further investigation, I realized that this occurred on the silo level not at the grain level, which means that all timers which belong to each grain on a specific silo won't fire at all. Even if I registered them again (when the grain was already active), they would fire only for the first time.

from orleans.

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.