Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoDeleteOnIdle cannot be set on queue creation when also setting a dead letter forward #14539

Closed
3 of 6 tasks
hartwig-wutscher-ibm opened this issue Mar 26, 2021 · 4 comments · Fixed by #14692
Closed
3 of 6 tasks
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Bus

Comments

@hartwig-wutscher-ibm
Copy link

hartwig-wutscher-ibm commented Mar 26, 2021

  • Package Name: @azure/service-bus
  • Package Version: 7.0.3
  • Operating system: linux
  • nodejs
    • version: v12.21.0
  • browser
    • name/version:
  • typescript
    • version: 3.7.5
  • Is the bug related to documentation in

Describe the bug
autoDeleteOnIdle cannot be set on queue creation when also setting a dead letter forward, it is always created with the maximum period value, on asb on login I can set autodelete for this kind of queue

To Reproduce
Steps to reproduce the behavior:

import { ServiceBusAdministrationClient } from '@azure/service-bus';
(async () => {
  const admin = new ServiceBusAdministrationClient(process.env.AZURE_SB_CONNECTION_STRING);
  const q = 'test-idle-out';
  await admin.createQueue('deadletterqueue');
  const props = await admin.createQueue('test-idle-out', { autoDeleteOnIdle: 'PT20M' });
  const props2 = await admin.createQueue('test-idle-out-deadletter', { autoDeleteOnIdle: 'PT20M', forwardDeadLetteredMessagesTo: 'deadletterqueue' });
  console.log(props.autoDeleteOnIdle);
  console.log(props2.autoDeleteOnIdle);
  admin.deleteQueue('test-idle-out');
  admin.deleteQueue('test-idle-out-deadletter');
  admin.deleteQueue('deadletterqueue');
})();

Output:
PT20M
P10675199DT2H48M5.4775807S

Expected behavior
Output:
PT20M
PT20M

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 26, 2021
@ramya-rao-a ramya-rao-a added Client This issue points to a problem in the data-plane of the library. Service Bus labels Mar 26, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 26, 2021
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Mar 26, 2021
richardpark-msft pushed a commit to richardpark-msft/azure-sdk-for-js that referenced this issue Apr 2, 2021
…ear to take effect but don't actually alter the entity.

Fixes Azure#14539
@richardpark-msft
Copy link
Member

hi @hartwig-wutscher-ibm, I was able to replicate this bug and I really appreciate you taking the time to report it.

The actual bug was with the way we're sending the ATOM requests, which handle the entity update you're trying to do. I've got a fix submitted in this PR(#14692). This bug was actually causing forwarding to not be properly setup, even though the API claimed that it was.

With that said, the normal behavior of forwarding and autoDeleteOnIdle is actually correct, as explained here in the note at the end of the linked section.

@ghost ghost closed this as completed in #14692 Apr 5, 2021
ghost pushed a commit that referenced this issue Apr 5, 2021
… bad property ordering in XML (#14692)

The ordering of properties in the XML requests to the Service Bus ATOM API is significant and changing it can have side effects.

In this instance, the ordering issues caused us to appear to have setup forwarding properly for a queue but forwarding was NOT actually enabled. Our previous testing missed this because this data actually round-trips properly through the API but it doesn't trigger whatever actual setting needs to happen to cause forwarding to happen.

This PR reconciles our queue, topic and subscription entities ordering against the .net layer, which acts as the de-facto authority.

Fixes #14539
@HarshaNalluru
Copy link
Member

#14692 is merged, we'll release a new version for the package soon.

HarshaNalluru pushed a commit to HarshaNalluru/azure-sdk-for-js that referenced this issue Apr 5, 2021
… bad property ordering in XML (Azure#14692)

The ordering of properties in the XML requests to the Service Bus ATOM API is significant and changing it can have side effects.

In this instance, the ordering issues caused us to appear to have setup forwarding properly for a queue but forwarding was NOT actually enabled. Our previous testing missed this because this data actually round-trips properly through the API but it doesn't trigger whatever actual setting needs to happen to cause forwarding to happen.

This PR reconciles our queue, topic and subscription entities ordering against the .net layer, which acts as the de-facto authority.

Fixes Azure#14539
ghost pushed a commit that referenced this issue Apr 5, 2021
AdminClient: ForwardTo wasn't applying on update due to bad property ordering in XML (#14692)

The ordering of properties in the XML requests to the Service Bus ATOM API is significant and changing it can have side effects.

In this instance, the ordering issues caused us to appear to have setup forwarding properly for a queue but forwarding was NOT actually enabled. Our previous testing missed this because this data actually round-trips properly through the API but it doesn't trigger whatever actual setting needs to happen to cause forwarding to happen.

This PR reconciles our queue, topic and subscription entities ordering against the .net layer, which acts as the de-facto authority.

Fixes #14539
jay-most pushed a commit to jay-most/azure-sdk-for-js that referenced this issue Apr 26, 2021
… bad property ordering in XML (Azure#14692)

The ordering of properties in the XML requests to the Service Bus ATOM API is significant and changing it can have side effects.

In this instance, the ordering issues caused us to appear to have setup forwarding properly for a queue but forwarding was NOT actually enabled. Our previous testing missed this because this data actually round-trips properly through the API but it doesn't trigger whatever actual setting needs to happen to cause forwarding to happen.

This PR reconciles our queue, topic and subscription entities ordering against the .net layer, which acts as the de-facto authority.

Fixes Azure#14539
@hartwig-wutscher-ibm
Copy link
Author

Hi!

I've retested this using the above code with version 7.0.5 and the issue is persists, is the fix not yet published?

from package-lock.json:

    "@azure/service-bus": {
      "version": "7.0.5",
      "resolved": "https://registry.npmjs.org/@azure/service-bus/-/service-bus-7.0.5.tgz",
      "integrity": "sha512-x3VgZFLsmhnTka6IpKePHcibm3znMhcrSsVoVlMOCQSgoJrTSTuczRh4S9/c55pj8M+EQ6FdPweQY6Ld+g/qiQ==",
      "requires": {
        "@azure/abort-controller": "^1.0.0",
        "@azure/core-amqp": "^2.2.0",
        "@azure/core-asynciterator-polyfill": "^1.0.0",
        "@azure/core-auth": "^1.3.0",
        "@azure/core-http": "^1.2.0",
        "@azure/core-paging": "^1.1.1",
        "@azure/core-tracing": "1.0.0-preview.11",
        "@azure/logger": "^1.0.0",
        "@types/is-buffer": "^2.0.0",
        "@types/long": "^4.0.0",
        "buffer": "^5.2.1",
        "is-buffer": "^2.0.3",
        "jssha": "^3.1.0",
        "long": "^4.0.0",
        "process": "^0.11.10",
        "rhea-promise": "^1.2.0",
        "tslib": "^2.0.0"
      }
    },

output:

PT20M
P10675199DT2H48M5.4775807S

@richardpark-msft
Copy link
Member

@hartwig-wutscher-ibm - in your sample what you're running into is this behavior (this is copied from the service documentation here: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-auto-forwarding#using-autoforwarding)

When autoforwarding is setup, the value for AutoDeleteOnIdle on both the Source and the Destination is automatically set to the maximum value of the data type.

On the Source side, autoforwarding acts as a receive operation. So the source which has autoforwarding setup is never really "idle".
On the destination side, this is done to ensure that there is always a destination to forward the message to.

In this case when you do this:

  const props2 = await admin.createQueue('test-idle-out-deadletter', { autoDeleteOnIdle: 'PT20M', forwardDeadLetteredMessagesTo: 'deadletterqueue' });

You are effectively setting up auto-forwarding, which means that the autoDeleteOnIdle parameter will basically be ignored by the service.

(If I am misunderstanding what you're asking, please let me know).

@ramya-rao-a ramya-rao-a added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Jul 21, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Bus
Projects
None yet
4 participants