Project

General

Profile

Actions

Bug #833

open

CSD - Bind address error

Added by Alexandr Strakh almost 14 years ago. Updated over 11 years ago.

Status:
Open
Priority:
Normal
Assignee:
Category:
-
Start date:
02/11/2011
Due date:
% Done:

0%

Estimated time:
Detected in build:
81276a85d508846da2f7f87ab6728d9b5d3f5661
Platform:
Published in build:

Description

Sometimes CSD quits with message "Adress already in use..."

Ldv-core will check address and then run csd. But between Ldv-core checks and
starting CSD adress is unused.

It may be possible if running more than one ldv-tools and second CSD starts before the first.
1. ldv-core1 - find_free_address - 8080 -> starting csd1 with 8080
2. ldv_core2 - find_free_address - 8080 -> starting csd2 with 8080
3. csd2 - try to bind address 8080 - Ok
4. csd1 - try to bind address 8080 - failed because adress 8080 already busy (by csd2)


Related issues 3 (1 open2 closed)

Has duplicate Linux Driver Verification - Bug #976: ldv-core fails on qa because of conflict on some addressClosedPavel Shved03/25/2011

Actions
Is duplicate of Linux Driver Verification - Bug #1134: CSD fails again!RejectedPavel Shved04/25/2011

Actions
Blocks Linux Driver Verification - Feature #1261: Automatically prepare builds of development branches each nightNewPavel Shved05/21/2011

Actions
Actions #1

Updated by Pavel Shved almost 14 years ago

A way to do it without races is like this. Do not first check, then start server with the port found. Just start server at once, and if it fails with "already in use" error, attempt to start it on the next port. This way you'll start a server without any races.

Then the server somehow informs the calling program about the port it's managed to bind to (via standard output, or a pid-based temp file), and the calling program connects to that port.

To make a workaround, you might just sleep for a random time before checking if the port's in use.

Actions #2

Updated by Alexandr Strakh almost 14 years ago

I will check the STDERR for a message "address already in use" in case of crash CSD. And then try to run CSD with new address.

Actions #3

Updated by Pavel Shved almost 14 years ago

Alexandr Strakh wrote:

I will check the STDERR for a message "address already in use" in case of crash CSD. And then try to run CSD with new address.

Ok, but make sure you'll still show other error messages to user. Don't forget to add comments about that!

Actions #4

Updated by Pavel Shved over 13 years ago

  • Assignee changed from Alexandr Strakh to Pavel Shved

Reassigning Alexander's bugs, due to his transfer to the other project.

Actions #5

Updated by Pavel Shved over 13 years ago

  • Status changed from New to Rejected

This is good old "Bind address error" from bug #833. Night tests were running simultaneously with tests for the new commits in master.

Closing as a duplicate.

Actions #6

Updated by Pavel Shved over 13 years ago

  • Status changed from Rejected to Open
  • Priority changed from Normal to High

... now that was as stupid race condition bug in Redmine...

Actions #7

Updated by Pavel Shved over 13 years ago

Just to not forget.

On my way home I realized one important thing, inspired by comment 4 to bug #974. This issue with race condition in address assignment would be much easier to solve if ldv-core was the server, and CSD was the client, not vice versa...

Actions #8

Updated by Pavel Shved over 13 years ago

  • Priority changed from High to Normal

It will become less urgent when we'll make QA server not require builds for each commit.

Actions #9

Updated by Alexey Khoroshilov almost 13 years ago

The right solution is proposed above:

Pavel Shved wrote:

if ldv-core was the server, and CSD was the client, not vice versa...

For now, trying to reduce probability of the race, I have committed a patch to select random ports from 8080 to 8099 instead of predefined sequence starting from 8080.

Actions #10

Updated by Evgeny Novikov almost 13 years ago

I don't know internals, but can't we "lock" a found address at the same time when it's found? In this case other ldv-core instances will find other addresses...

Actions #11

Updated by Evgeny Novikov over 11 years ago

  • Category deleted (Infrastructure)
  • Assignee changed from Pavel Shved to Ilja Zakharov

Please, read it thoroughly!

Actions

Also available in: Atom PDF