メインコンテンツへスキップ

Restart Gurobi Compute Server job with python code after status 502

ユーザーの入力を待っています。

コメント

4件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff

    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.

  • Alex Ginete
    • Gurobi Staff

    Hi Hancheng,

    You can implement a retry mechanism using a try-except block. Something like:

    try:
        model.optimize()
    except gp.GurobiError as e:
        error_message = str(e)
        if "status 502" in error_message:
            print("Retrying due to 502")
            model.optimize()

    However, this only retries to optimize the model once. Setting up a retry limit can mitigate this.

    Regards,
    Alex

    0
  • Hancheng Li
    • Gurobi-versary
    • Curious
    • First Comment

    Hi Alex. Thanks for the response, but I don't think it solves the issue, as the code is failing at model creation when it initially communicates with the Compute Server. I think it's gone into idle shutdown after 60 minutes per the Instant Cloud documentation

    model = gp.Model("model_name")

    If I put a try-except here, the except needs to be some command that wakes up the server from idle

    0
  • Alex Ginete
    • Gurobi Staff

    Hi Hancheng,

    Since you are using Instant Cloud, can you provide me the Job ID so I can check the logs?

    Regards,
    Alex

    0

投稿コメントは受け付けていません。