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

Discarded report from unrecognized worker #3003

Open
2 tasks done
michie1 opened this issue Dec 2, 2024 · 4 comments
Open
2 tasks done

Discarded report from unrecognized worker #3003

michie1 opened this issue Dec 2, 2024 · 4 comments
Labels

Comments

@michie1
Copy link

michie1 commented Dec 2, 2024

Prerequisites

Description

This is a follow up of #3000. The UI now shows the correct number, but only when one worker node is used. When adding --processes 10 and specifying 10 users in the UI I still get a lower number in the UI compared with what the nodejs command is showing.

The logs is saying "locust.runners: ... reported that is has stopped" and later "Discarded report from unrecognized worker ...". This is logged multiple times for multiples runners.

const http = require('http');

let requestCount = 1;

const server = http.createServer((req, res) => {
  setTimeout(() => {
    console.log(requestCount);
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end(`Request count: ${requestCount}`);
    requestCount++; // Increment the request counter
  }, 1000);
});

const PORT = 3000;
server.listen(PORT, () => {
    console.log(`Server running at http://localhost:${PORT}`);
});

Command line

locust -s 10 --processes 10

Locustfile contents

from locust import HttpUser, task

i = 0

class HelloWorldUser(HttpUser):
    @task
    def hello_world(self):
        global i
        print("before", i)
        self.client.get("/")
        print("after", i)
        i += 1


### Python version

3.10

### Locust version

2.32.4

### Operating system

Ubuntu 22.04.5 WSL
@michie1 michie1 added the bug label Dec 2, 2024
@michie1
Copy link
Author

michie1 commented Dec 2, 2024

image

@michie1
Copy link
Author

michie1 commented Dec 2, 2024

Same holds when I remove the setTimeout (I thought maybe that would introduce count differences) and specify the Runtime to 10 seconds instead of clicking on the "Stop" button.

(--headless returns the correct count.)

@cyberw
Copy link
Collaborator

cyberw commented Dec 4, 2024

I can reproduce this as well. I wonder when it broke... Anyways, I'm on it...

@cyberw
Copy link
Collaborator

cyberw commented Dec 4, 2024

Actually, I'm only able to reproduce it with --stop-timeout. I still sometimes get the log message at shutdown without -s, but then no requests are actually missing (so probablly going to drop that log message level to debug). So still a bug, but much smaller scope...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants