Azure / azure-event-hubs-node

Node client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
MIT License
50 stars 46 forks source link

Include partitionId in AzureBlobLeaseInfo #167

Closed dan-drl closed 5 years ago

dan-drl commented 5 years ago

This addresses an issue where partitionId would be undefined causing the host to fail. The response from blob.getContent() looked something like this:

{"owner":"js-host-0826076f-42f3-4129-b1fb-6695733d532d","epoch":22,"sequenceNumber":0,"token":"174f6f89-e253-4fd2-ae6d-210aad163c41"}

On a side note, I also tried the C# event hub processor and it had no issues. I inspected the web traffic, and the response from azure looks almost identical and doesn't contain the partition id.

Here's some console output that shows error:

 azure:eph:partitionScanner [js-host-0826076f-42f3-4129-b1fb-6695733d532d] [0] Acquired unowned/expired lease.undefined +201ms
  azure:eph:completeLease [js-host-0826076f-42f3-4129-b1fb-6695733d532d] [undefined] Lease info is: { partitionId: undefined, owner: 'js-host-0826076f-42f3-4129-b1fb-6695733d532d', epoch: 18 } +42ms
  azure:eph:azurebloblease [js-host-0826076f-42f3-4129-b1fb-6695733d532d] [undefined] Lease info is: { partitionId: undefined, owner: 'js-host-0826076f-42f3-4129-b1fb-6695733d532d', epoch: 18, sequenceNumber: 0, token: '59746238-4501-459e-a585-bd8f4fb39038', offset: undefined } +41ms
  azure:eph:pumpManager [js-host-0826076f-42f3-4129-b1fb-6695733d532d] [N/A] Creating a new pump with lease { partitionId: undefined, owner: 'js-host-0826076f-42f3-4129-b1fb-6695733d532d', epoch: 18, sequenceNumber: 0, token: '59746238-4501-459e-a585-bd8f4fb39038', offset: undefined }. +0ms
  azure:eph:partitionPump [js-host-0826076f-42f3-4129-b1fb-6695733d532d] [N/A] Getting the initial offset. +0ms
  azure:eph:error [js-host-0826076f-42f3-4129-b1fb-6695733d532d] [N/A] An error occurred while adding/updating a pump for partitionId 'undefined': TypeError: partitionId is required. Given value: undefined. Hence it cannot be null or undefined.
    at Object.validateType (C:\sources\git\spew\SpewSocketIO\node_modules\@azure\event-processor-host\dist\lib\util\utils.js:24:15)
    at AzureStorageCheckpointLeaseManager.<anonymous> (C:\sources\git\spew\SpewSocketIO\node_modules\@azure\event-processor-host\dist\lib\azureStorageCheckpointLeaseManager.js:394:21)
    at Generator.next (<anonymous>)
    at C:\sources\git\spew\SpewSocketIO\node_modules\tslib\tslib.js:107:75
    at new Promise (<anonymous>)
    at Object.__awaiter (C:\sources\git\spew\SpewSocketIO\node_modules\tslib\tslib.js:103:16)
    at AzureStorageCheckpointLeaseManager.getCheckpoint (C:\sources\git\spew\SpewSocketIO\node_modules\@azure\event-processor-host\dist\lib\azureStorageCheckpointLeaseManager.js:393:24)
    at PartitionContext.<anonymous> (C:\sources\git\spew\SpewSocketIO\node_modules\@azure\event-processor-host\dist\lib\partitionContext.js:108:78)
    at Generator.next (<anonymous>)
    at C:\sources\git\spew\SpewSocketIO\node_modules\tslib\tslib.js:107:75. +0ms
amarzavery commented 5 years ago

:white_check_mark: Validation status: passed

File Status Preview URL Details
processor/lib/azureStorageCheckpointLeaseManager.ts :white_check_mark:Succeeded

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.