Skip to content

createInternalActionId > actionIdCount reaching long.MaxValue #276

Description

@nomz0101

Hi,

We have noticed that when actionIdCount reaches long max value this can cause serious issues that include timeouts.
When the count reaches max value, and then is incremented it switches to negative values and can cause collisions.

What I did to fix it is change the method to the below.
Could this be included in the next release please if you agree on this protection?

private string createInternalActionId()
{
	lock (string.Intern("CONNECTIONMANAGER::createInternalActionId::actionIdCount"))
	{
		if (actionIdCount >= long.MaxValue-1)
		{
			actionIdCount = 0;
		}
		return this.GetHashCode() + "_" + (this.actionIdCount++);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug in the project that needs to be fixed.help wanted (easy)Looking for help with this, the issue should however be simple so anyone can help.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions