Code Monkey home page Code Monkey logo

Comments (4)

cf-gitbot avatar cf-gitbot commented on July 18, 2024

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/158653339

The labels on this github issue will be updated when the story is started.

from discovery.

TimHess avatar TimHess commented on July 18, 2024

That does sound unusual, have you tried setting your own value for eureka:instance:leaseExpirationDurationInSeconds? By default, your app should stay registered for 90 seconds - you could lower that and eureka:instance:leaseRenewalIntervalInSeconds to see if anything changes.

from discovery.

kimbell avatar kimbell commented on July 18, 2024

I'm also having the same problem and I've been digging around a bit. When browsing the code, I can't see many references to ApplicationLifecycle or IDiscoveryLifecycle, so I added the following in my startup class.

lifetime.ApplicationStopping.Register(() =>
{
    var eurekaClient = app.ApplicationServices.GetRequiredService<EurekaDiscoveryClient>();
    eurekaClient?.ShutdownAsync().GetAwaiter().GetResult();
});

This still didn't work as expected, so I downloaded the code and ran using that. I think I have spotted a bug in EurekaDiscoverClient.cs

public override T.Task ShutdownAsync()
        {
            _appInfoManager.InstanceStatus = InstanceStatus.DOWN;
            return ShutdownAsync();
        }

When this is called, it ends up in a recursive loop since it's calling itself. I imagine it should be calling the base class version of ShutDownAsync(). When I made this change, things seemed to be working better.

public override T.Task ShutdownAsync()
        {
            _appInfoManager.InstanceStatus = InstanceStatus.DOWN;
            return base.ShutdownAsync();
        }

from discovery.

TimHess avatar TimHess commented on July 18, 2024

#39 should resolve this issue (thanks @kimbell!) -- That pull request was included in the 2.1.0 release of Steeltoe, please try the updated package and see if that resolves the issue for you!

from discovery.

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.