Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Problem with hashing #171

@Sirorezka

Description

@Sirorezka

New version of 'hash' in python give different values during execution of each thread when doing multiprocessing. Following error will accure:

50000_firms/start.py return error when running in 2 or more processess:
KeyError: ('myagent', 11980)

There is problem with three functions which use 'hash':
multiprocessing.py -- def insert_or_append
multiprocessing.py -- def do
agent.py -- def _send_multiprocessing

my proposal - replace default hash function with:

import hashlib
def new_hash(agent_key):
    return int(hashlib.md5(str(agent_key).encode()).hexdigest()[:8],16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions