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

QDEL_IN harddel prevention #60937

Merged
merged 8 commits into from Aug 20, 2021
Merged

Conversation

BraveMole
Copy link
Contributor

About The Pull Request

QDEL_IN could hardel if the timer was greater than 5 minutes (time for the qdel queue)

we can use weakref to prevent this

Why It's Good For The Game

Changelog

🆑
code: prevent possible QDEL_IN harddel
/:cl:

@tgstation-server tgstation-server added the Code Improvement Code is now easier to copy paste. label Aug 19, 2021
@github-actions
Copy link
Contributor

You currently have a negative Fix/Feature pull request delta of -2. Maintainers may close this PR at will. Fixing issues or improving the codebase will improve this score.

@LemonInTheDark LemonInTheDark added the Hard Deletes Whac-A-Mole with blackjack and cpu time label Aug 20, 2021
code/controllers/subsystem/garbage.dm Outdated Show resolved Hide resolved
code/__HELPERS/qdel.dm Outdated Show resolved Hide resolved
code/__DEFINES/qdel.dm Outdated Show resolved Hide resolved
@@ -1,4 +1,4 @@
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE)
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, time > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, does qdel() support dereferencing weakrefs? At a glance this seems like it'd just delete the weakref datum.

Copy link
Contributor Author

@BraveMole BraveMole Aug 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes #56171

And there's an exemple in crabs.

Copy link
Member

@MrStonedOne MrStonedOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix up the qdel thing

@Cyberboss Cyberboss merged commit af48bda into tgstation:master Aug 20, 2021
@github-actions
Copy link
Contributor

Your Fix/Feature pull request delta is now above zero (10). Feel free to make Feature/Balance PRs.

github-actions bot added a commit that referenced this pull request Aug 20, 2021
LemonInTheDark pushed a commit to LemonInTheDark/tgstation that referenced this pull request Dec 12, 2021
* QDEL_IN harddel prevention (tgstation#60937)

QDEL_IN could hardel if the timer was greater than 5 minutes (time for the qdel queue)

we can use weakref to prevent this

* QDEL_IN harddel prevention

Co-authored-by: BraveMole <bsouchu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Improvement Code is now easier to copy paste. Hard Deletes Whac-A-Mole with blackjack and cpu time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants