labgrid-project / labgrid-project/labgrid

release --kick doesn't clean the reservations table

Open
#1,253 1 comment 0 reactions 1 assignee View on GitHub

@Emantor is already working on this.

Since Jul 28, 2023.

bug
Dominant language
Python
Stars
528
Forks
278
Avg merge
2d 19h
Merged PRs (30d)
4

Description

Hi,

I have below scenario:

  1. user1: makes a reservation for a board
  2. user1: lock the board
  3. user2: release --kick the board

After step 3 , the board is not acquired by anyone , but it can be re-acquired/locked only by user1 because the reservation table still keeps a record of allocated for that place to user1 - is this the wanted behavior? Shouldn't kick be more aggressive and also clean the reservation?

and with the commands/output:
user1: makes a reservation for a board:

(venv) user1@ws1:~/work$ labgrid-client reserve --wait name=RO--MX6Q_sabresd--2
Reservation 'UYOHFZXX2A':
  owner: workstation1/user1
  token: UYOHFZXX2A
  state: allocated
  filters:
    main: name=RO--MX6Q_sabresd--2
  allocations:
    main: RO--MX6Q_sabresd--2
  created: 2023-07-28 14:41:28.345891
  timeout: 2023-07-28 14:42:28.346233
Waiting for allocation...
(venv) user1@ws1:~/work$ labgrid-client  reservations
Reservation 'UYOHFZXX2A':
  owner: workstation1/user1
  token: UYOHFZXX2A
  state: allocated
  filters:
    main: name=RO--MX6Q_sabresd--2
  allocations:
    main: RO--MX6Q_sabresd--2
  created: 2023-07-28 14:41:28.345891
  timeout: 2023-07-28 14:42:28.407206
(venv) user1@ws1:~/work$ labgrid-client who | grep RO--MX6Q_sabresd--2
(venv) user1@ws1:~/work$

user1: lock the board

(venv) user1@ws1:~/work$ labgrid-client -p RO--MX6Q_sabresd--2 lock
acquired place RO--MX6Q_sabresd--2
(venv) user1@ws1:~/work$ labgrid-client who | grep RO--MX6Q_sabresd--2
user1  workstation1  RO--MX6Q_sabresd--2       2023-07-28 14:42:10.493009
(venv) user1@ws1:~/work$ labgrid-client  reservations
Reservation 'UYOHFZXX2A':
  owner: workstation1/user1
  token: UYOHFZXX2A
  state: acquired
  filters:
    main: name=RO--MX6Q_sabresd--2
  allocations:
    main: RO--MX6Q_sabresd--2
  created: 2023-07-28 14:41:28.345891
  timeout: 2023-07-28 14:43:10.493459

user2: release --kick the board

(venv) user2@ws2:~/test$ labgrid-client -p RO--MX6Q_sabresd--2 release --kick
warning: kicking user (workstation1/user1)
released place RO--MX6Q_sabresd--2

After step 3 , the board is not acquired by anyone , but it can be re-acquired/locked only by user1

(venv) user2@ws2:~/test$  labgrid-client -p RO--MX6Q_sabresd--2 acquire
labgrid-client: error: failed to acquire place RO--MX6Q_sabresd--2
(venv) user2@ws2:~/test$ labgrid-client -p RO--MX6Q_sabresd--2 lock
labgrid-client: error: failed to acquire place RO--MX6Q_sabresd--2
(venv) user1@ws1:~/work$ labgrid-client  reservations
Reservation 'UYOHFZXX2A':
  owner: workstation1/user1
  token: UYOHFZXX2A
  state: allocated
  filters:
    main: name=RO--MX6Q_sabresd--2
  allocations:
    main: RO--MX6Q_sabresd--2
  created: 2023-07-28 14:41:28.345891
  timeout: 2023-07-28 14:43:43.625886
(venv) user1@ws1:~/work$ labgrid-client who | grep RO--MX6Q_sabresd--2
(venv) user1@ws1:~/work$ labgrid-client -p RO--MX6Q_sabresd--2 lock
acquired place RO--MX6Q_sabresd--2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.