Unique ID for PASOE ABL session? - Forum - OpenEdge Development - Progress Community
 Forum

Unique ID for PASOE ABL session?

This question is not answered

Is there any way within an ABL session under PASOE to get some the Process ID (PID) of the agent, and some sort of unique identifier of the specific session within the multi-session agent?

In the appname.agent.log file, the prefix for each entry appears to show PIDs, as well as some unique values preceded by T- and AS-:

[19/07/30@11:22:02.119-0500] P-015080 T-008024 1 AS-8 ...

I'm wondering how I could get those programmatically, since it would be useful for troubleshooting.

Thanks in advance.

All Replies
  • Thank you for your comments Steve. If you think the API description are not sufficient or they do not have enough information ,then please raise a ticket with Tech Support. We will definitely try to improve in that area.

    I have attached the screenshot of the API that David pointed out. Please take a look

    oemanagerAPI.docx

    Regards,

    Irfan

  • As a followup question, I'm wondering how SessionID and AgentID from SESSION:CURRENT-REQUEST-INFO is related to the oemanager APIs?

    For example, testing just now in my app:

    SESSION:CURRENT-REQUEST-INFO:AgentID = 4932

    SESSION:CURRENT-REQUEST-INFO:SessionID = 7

    but the oemanager/applications/{appname}/sessions API returns this, which has AgentID and SessionID inside it, but with random Base64-looking values that don't appear to match up:

    {
      "result": {
        "OEABLSession": [
          {
            "adapterType": "",
            "bound": false,
            "requestID": "",
            "elapsedTimeMs": 395921,
            "ablSessionID": "",
            "lastAccessStr": "2019-07-31T10:44:02.014-0500",
            "agentConnInfo": null,
            "sessionID": "lR8JgyIwR6uODfpOhoP4tg",
            "clientConnInfo": null,
            "sessionState": "RESERVED",
            "agentID": "",
            "requestState": "READY",
            "sessionPoolID": "CZDEum6oSD-ylM2TUt91KQ",
            "sessionType": "SESSION_FREE"
          },
          {
            "adapterType": "WEB",
            "bound": false,
            "requestID": "Ingrid:w:0000001a",
            "elapsedTimeMs": 5265,
            "ablSessionID": "",
            "lastAccessStr": "2019-07-31T10:50:32.670-0500",
            "agentConnInfo": {
              "state": "RESERVED",
              "connPoolID": "osovtHUPTCifAUctF8_Q5w",
              "connID": "7LEBvJGISKWrJ2eSQD1KDw",
              "agentAddr": "/0.0.0.0:62002",
              "localAddr": "/127.0.0.1:51745",
              "agentID": "g5Ce8GboT-KMFnGC5vd5Pg"
            },
            "sessionID": "64tl7R6UQnmeuW7rvysSZw",
            "clientConnInfo": {
              "adapterType": "WEB",
              "requestProcedure": "Progress.Web.InternalWebHandler:HandleRequest",
              "requestID": "Ingrid:w:0000001a",
              "elapsedTimeMs": 5274,
              "httpSessionId": "FF1098787A8A28B4BDF91D5E767D22BEB8619D60D1A5.lisa",
              "sessionID": "64tl7R6UQnmeuW7rvysSZw",
              "reqStartTimeStr": "2019-07-31T10:50:32.662-0500",
              "executerThreadId": "thd-5",
              "clientName": "0:0:0:0:0:0:0:1",
              "requestUrl": null
            },
            "sessionState": "RESERVED",
            "agentID": "g5Ce8GboT-KMFnGC5vd5Pg",
            "requestState": "RUNNING",
            "sessionPoolID": "CZDEum6oSD-ylM2TUt91KQ",
            "sessionType": "SESSION_FREE"
          },
          {
            "adapterType": "WEB",
            "bound": false,
            "requestID": "Ingrid:w:0000001b",
            "elapsedTimeMs": 4054,
            "ablSessionID": "",
            "lastAccessStr": "2019-07-31T10:50:33.882-0500",
            "agentConnInfo": {
              "state": "RESERVED",
              "connPoolID": "osovtHUPTCifAUctF8_Q5w",
              "connID": "KYODMP_ZSqauAKK1_-00Lg",
              "agentAddr": "/0.0.0.0:62002",
              "localAddr": "/127.0.0.1:51778",
              "agentID": "g5Ce8GboT-KMFnGC5vd5Pg"
            },
            "sessionID": "iSaU_7cRTFyDN0ldMP8ziQ",
            "clientConnInfo": {
              "adapterType": "WEB",
              "requestProcedure": "Progress.Web.InternalWebHandler:HandleRequest",
              "requestID": "Ingrid:w:0000001b",
              "elapsedTimeMs": 4059,
              "httpSessionId": "FF1098787A8A28B4BDF91D5E767D22BEB8619D60D1A5.lisa",
              "sessionID": "iSaU_7cRTFyDN0ldMP8ziQ",
              "reqStartTimeStr": "2019-07-31T10:50:33.877-0500",
              "executerThreadId": "thd-10",
              "clientName": "0:0:0:0:0:0:0:1",
              "requestUrl": null
            },
            "sessionState": "RESERVED",
            "agentID": "g5Ce8GboT-KMFnGC5vd5Pg",
            "requestState": "RUNNING",
            "sessionPoolID": "CZDEum6oSD-ylM2TUt91KQ",
            "sessionType": "SESSION_FREE"
          }
        ]
      },
      "errmsg": "",
      "outcome": "SUCCESS",
      "versionStr": "v11.7.4 ( 2018-10-10 )",
      "versionNo": 1,
      "operation": "GET CLIENT SESSIONS"
    }


  • Steve,

    The sessionId's you are looking at from SessionManager which are tomcat sessionId's. You should be looking at the AgentManager API's to get the ABL SessionId's. In the document attached I have provided you the exact API.

    When you access "Get Agents" API, you get two values "AgentPID" and "AgentID". AgentPID is the MS-Agent PID and AgentID is the unique identifier of the agent used for administration purposes by not exposing the agent PID information.

    Regards,

    Irfan

  • Please pardon my ignorance here - I think the nomenclature is throwing me off.  There are so many things called "session" that it's confusing me.  It's not clear to me in some cases whether session relates to a session in the MS agent, something tomcat related, or the HTTP session of the user.

    What I'm really looking for in all of this is how I can use whatever tools are available to remedy a stuck request.

    So, if my MS Agent has several sessions going, each of which may be serving a request, but one of the requests is hosed and has become a runaway process, how would I find that and kill it?  How would I take the information gleaned in finding what Agent/Session/Request failed, and match that up to data that my app can store, and use that to hunt down and fix the bug?

    Is it even possible to kill just one session in the MS Agent?  You wouldn't want to kill the whole agent and disrupt everyone's work to fix one problem, right?

    Edit:  I just figured this out, so I'll share in case it helps someone else:

    First, you need the agent PID and the MS Agent SessionID for the abl session running the program.

    If for example, the agent PID is 4932 and the sessionID is 7, then do this:

    1. Log into the oemanager

    2. Run /applications/{appName}/agents with the name of the application

    3. Locate the agent PID within the results, and copy the corresponding agentID value

    4. Now with that agentID value, run the /applications/{appName}/agents/{id}/{component}

      1. Use the copied agentID instead of {id}. (In this case, g5Ce8GboT-KMFnGC5vd5Pg)

      2. Use “sessions” instead of {component}

      3. You can verify that the session is still busy with the request, and that it’s the correct one you want to kill.

    5. Run the DELETE on /applications/{appName}/agents/{agentID}/sessions/{sessionID}

      1. Use the copied alphanumeric agentID (In this case, g5Ce8GboT-KMFnGC5vd5Pg)

      2. Use the integer SessionID  (In this case 7)

  • Thank you Steve, I was about to respond the same. There are different ways of doing it. This API basically makes sure the HTTP request is terminated which will make sure the ABL Session that is executing will be cancelled.

    In-case you want to terminate an ABL Session, then you can do it by executing "Terminate ABL Session" API using the DELETE operation. In-case you want to see where it is going wrong, then look for "Get MS-Agent stacks" API.  If your agent is in a bad state( growing memory or hosed) you can use "stop MS-Agent" API which will allow the existing requests to finish and the new requests will be routed to a new agent.

    For your use-case, first option is the right choice.

    Regards,

    Irfan