Closed sentry-io[bot] closed 1 week ago
Note from @nforro : this looks not possible to reproduce so we can start with adding some debug info to know more.
Since the issue used to happen when running Packit integration tests, I tried running the test suite locally in a container in a loop, as well as running the full
test plan and packit-integration
test plan from specfile
with tmt in a VM a number of times, but the issue never appeared.
I've added some debugging messages to specfile
and deployed it to both stage and prod, so hopefully the next time this happens we will have more info. Though I'm still puzzled how this can happen, rpm_spec
should never be None
, not without SpecfileException
being raised first.
Closing it because it does not happened again (after printing debug informations).
Sentry Issue: PCKT-002-PACKIT-SERVICE-8CZ
Sentry Issue: PCKT-002-PACKIT-SERVICE-8CZ
I was finally able to obtain useful info from the logs and even reproduce the problem locally, however in order to trigger it the time between setting spec
to None
and creating a "new" Specfile
instance must be very short, otherwise everything works properly:
>>> from specfile import Specfile
>>> spec = Specfile("test.spec")
>>> spec.rpm_spec
<rpm.spec object at 0x7f6d99733830>
>>> spec = None
>>> spec = Specfile("test.spec")
>>> spec.rpm_spec
>>>
There is something weird going on, it almost looks like if the old Specfile
instance is not garbage-collected quickly enough it is reused instead of creating a new instance. But let me investigate further.
it almost looks like if the old
Specfile
instance is not garbage-collected quickly enough it is reused instead of creating a new instance
The instance is not reused, a new one is created, but the id of the old one is reused. And that's a problem because of the context switch detection implementation that relies on id.
Sentry Issue: PCKT-002-PACKIT-SERVICE-78H