Datastores: OnUpdate budget in Studio never increases and OnUpdate calls never throw nor throttle

When OnUpdate is used through plugins or through the command bar in Studio, the Datastore budget for OnUpdate calls does decrease, but never increments over time like the other budget types. Moreover, OnUpdate requests never throw through plugins/command bar when they otherwise would in a live instance that uses Datastores.

How to reproduce:

  1. Open a baseplate in Studio and publish it to a game with API access.
  2. Run this code in the command bar:
local DataStoreService = game:GetService("DataStoreService")
print("start:", DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.OnUpdate))

for i = 1, 15 do
   DataStoreService:GetDataStore("Test"):OnUpdate("TestKey"..i, function() end)
end

print("after:", DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.OnUpdate))

wait(30)

print("waited:", DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.OnUpdate))

for i = 1, 200 do -- way too many for budget
   spawn(function()
      DataStoreService:GetDataStore("Test"):OnUpdate("TestKey"..i, function() end)
   end)
end

  1. Look at the output after a minute.

Observed behavior:
This appears in the output:

start: 15
after: 0
waited: 0
<no other output>

This is unexpected because according to the Datastore limits, the budget should have increased back to 15 on the “waited” print. I waited half a minute, and the per-minute rate of OnUpdate budget is 30, so it should have been +30/2 = +15 requests. The budget never increases back from 0 no matter how long you wait.

Moreover, I should have received errors at the very end after “waited”, because I’m trying to connect 200 OnUpdate callbacks at the same time, which definitely should have exhausted the budget and the throttling queue.

Expected behavior:

start: 15
after: 0
waited: ~15
<INSERT A BUNCH OF WARNINGS/ERRORS DUE TO THROTTLING HERE>

The budget should have (more or less) recovered after waiting 30 seconds.

I also expect a ton of warnings and errors because I am trying to connect OnUpdate calls when there’s no more budget, and I’m calling 200 times which is more than enough to overflow the throttling queue and cause requests to throw.

Other information:
The starting budget of OnUpdate also seems incorrect. In live instances, it is 30, while in Studio use cases, it starts at 15. All other budget starting values (get, set, update, setsorted, getsorted) match between live and Studio.

3 Likes