- 
                Notifications
    You must be signed in to change notification settings 
- Fork 637
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
The documentation states that a Logs live tail session can be stopped by calling client.destroy(): https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/example_cloudwatch-logs_StartLiveTail_section.html
    const client = new CloudWatchLogsClient();
    const command = new StartLiveTailCommand({
        logGroupIdentifiers: logGroupIdentifiers,
        logStreamNames: logStreamNames,
        logEventFilterPattern: filterPattern
    });
    try{
        const response = await client.send(command);
        handleResponseAsync(response);
    } catch (err){
        // Pre-stream exceptions are captured here
        console.log(err);
    }
    /* Set a timeout to close the client. This will stop the Live Tail session. */
    setTimeout(function() {
        console.log("Client timeout");
        client.destroy();
      }, 10000);However that doesn't work, the session still runs.
I think this is the same problem as #3922 with the Transcribe client. This issue was fixed in #4400 by adding code in destroy().
If we look at the code, the destroy() method doesn't do anything: 
aws-sdk-js-v3/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts
Lines 664 to 666 in d9a4bcc
| destroy(): void { | |
| super.destroy(); | |
| } | 
SDK version number
"@aws-sdk/client-cloudwatch-logs": "^3.632.0"
Which JavaScript Runtime is this issue in?
Browser
Details of the browser/Node.js/ReactNative version
Chrome
Reproduction Steps
    const client = new CloudWatchLogsClient();
    const command = new StartLiveTailCommand({
        logGroupIdentifiers: logGroupIdentifiers,
        logStreamNames: logStreamNames,
        logEventFilterPattern: filterPattern
    });
    try{
        const response = await client.send(command);
        handleResponseAsync(response);
    } catch (err){
        // Pre-stream exceptions are captured here
        console.log(err);
    }
    /* Set a timeout to close the client. This will stop the Live Tail session. */
    setTimeout(function() {
        console.log("Client timeout");
        client.destroy();
      }, 10000);Observed Behavior
The async function is still called, the HTTP request is not closed.
Expected Behavior
The HTTP request is closed and the async function no longer receives events.
Possible Solution
No response
Additional Information/Context
I think this is the same problem as #3922 with the Transcribe client. This issue was fixed in #4400 by adding code in destroy().
If we look at the code, the destroy() method doesn't do anything: 
aws-sdk-js-v3/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts
Lines 664 to 666 in d9a4bcc
| destroy(): void { | |
| super.destroy(); | |
| } |