creating an issue with an assignee enters a deadlock when [queue].TYPE=immediate #13185

Closed
opened 2025-11-02 10:34:04 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @twenty-panda on GitHub (Jun 21, 2024).

Description

Steps to reproduce:

docker run --name gitea -p 3000:3000 -e "RUN_MODE=dev"  -e "GITEA__security__INSTALL_LOCK=true" -e "GITEA__queue__TYPE=dummy" -d gitea/gitea:nightly
docker exec --user 1000 gitea gitea admin user create --admin --username root --password admin1234 --email admin@example.com
curl --json '{"name":"test"}' http://root:admin1234@0.0.0.0:3000/api/v1/user/repos
curl --json '{"title":"test","assignees":["root"]}' http://root:admin1234@0.0.0.0:3000/api/v1/repos/root/test/issues

What happens:

  • Gitea becomes globally unresponsive

What should happen:

  • The issue is created

Gitea Version

v1.22 & main

How are you running Gitea?

This surfaced while writing tests and using an immediate queue to reduce the need for asynchronous wait loops.

Originally created by @twenty-panda on GitHub (Jun 21, 2024). ### Description Steps to reproduce: ``` docker run --name gitea -p 3000:3000 -e "RUN_MODE=dev" -e "GITEA__security__INSTALL_LOCK=true" -e "GITEA__queue__TYPE=dummy" -d gitea/gitea:nightly docker exec --user 1000 gitea gitea admin user create --admin --username root --password admin1234 --email admin@example.com curl --json '{"name":"test"}' http://root:admin1234@0.0.0.0:3000/api/v1/user/repos curl --json '{"title":"test","assignees":["root"]}' http://root:admin1234@0.0.0.0:3000/api/v1/repos/root/test/issues ``` What happens: * Gitea becomes globally unresponsive What should happen: * The issue is created ### Gitea Version v1.22 & main ### How are you running Gitea? This surfaced while writing tests and using an immediate queue to reduce the need for asynchronous wait loops.
GiteaMirror added the issue/not-a-bug label 2025-11-02 10:34:04 -06:00
Author
Owner

@kemzeb commented on GitHub (Jun 21, 2024):

Looking at the config cheatsheet and some of the code, [queue].TYPE supports channel, redis, dummy, and level (which is the default). It also uses the default in case of invalid types. Because of this, immediate should be an invalid type and therefore will be treated as level. So I'm unsure if this is the source of the problem.

I also ran my Gitea dev instance with the following config added and haven't been able to reproduce on v1.23:

[queue]
TYPE=immediate

Can you also provide:

  • Logs that are produced when you reproduce the problem
  • Your configuration

UPDATE: Even though it is not documented, we do accept immediate (see here). It is treated just like dummy. Because of this, I am not quite sure what is happening here, but I think it would still be useful to provide the info above.

@kemzeb commented on GitHub (Jun 21, 2024): Looking at the [config cheatsheet](https://docs.gitea.com/administration/config-cheat-sheet#queue-queue-and-queue) and some of the [code](https://github.com/go-gitea/gitea/blob/996037fb6a61b1a7f9a0a837fd87bbeab9cad154/modules/queue/workerqueue.go#L204), [queue].TYPE supports `channel`, `redis`, `dummy`, and `level` (which is the default). It also uses the default in case of invalid types. Because of this, `immediate` should be an invalid type and therefore will be treated as `level`. So I'm unsure if this is the source of the problem. I also ran my Gitea dev instance with the following config added and haven't been able to reproduce on v1.23: ```ini [queue] TYPE=immediate ``` Can you also provide: - Logs that are produced when you reproduce the problem - Your configuration **UPDATE**: Even though it is not documented, we do accept `immediate` (see [here](https://github.com/go-gitea/gitea/blob/996037fb6a61b1a7f9a0a837fd87bbeab9cad154/modules/queue/workerqueue.go#L197)). It is treated just like `dummy`. Because of this, I am not quite sure what is happening here, but I think it would still be useful to provide the info above.
Author
Owner

@wxiaoguang commented on GitHub (Jun 22, 2024):

It has been commented in code. Do not use immediate for end users.

https://github.com/go-gitea/gitea/blob/main/modules/queue/workerqueue.go#L164

For testing, developers should take care of it, and I do not think we could drop that option.

@wxiaoguang commented on GitHub (Jun 22, 2024): It has been commented in code. Do not use immediate for end users. https://github.com/go-gitea/gitea/blob/main/modules/queue/workerqueue.go#L164 For testing, developers should take care of it, and I do not think we could drop that option.
Author
Owner

@twenty-panda commented on GitHub (Jun 22, 2024):

Here is a reproducer:

docker run --name gitea -p 3000:3000 -e "RUN_MODE=dev"  -e "GITEA__security__INSTALL_LOCK=true" -e "GITEA__queue__TYPE=dummy" -d gitea/gitea:nightly
docker exec --user 1000 gitea gitea admin user create --admin --username root --password admin1234 --email admin@example.com
curl --json '{"name":"test"}' http://root:admin1234@0.0.0.0:3000/api/v1/user/repos
curl --json '{"title":"test","assignees":["root"]}' http://root:admin1234@0.0.0.0:3000/api/v1/repos/root/test/issues

Hangs forever.

I only use this to write tests and I understand the limitations.

@twenty-panda commented on GitHub (Jun 22, 2024): Here is a reproducer: ``` docker run --name gitea -p 3000:3000 -e "RUN_MODE=dev" -e "GITEA__security__INSTALL_LOCK=true" -e "GITEA__queue__TYPE=dummy" -d gitea/gitea:nightly docker exec --user 1000 gitea gitea admin user create --admin --username root --password admin1234 --email admin@example.com curl --json '{"name":"test"}' http://root:admin1234@0.0.0.0:3000/api/v1/user/repos curl --json '{"title":"test","assignees":["root"]}' http://root:admin1234@0.0.0.0:3000/api/v1/repos/root/test/issues ``` Hangs forever. I only use this to write tests and I understand the limitations.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13185