You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
before_action do |controller|
is_feature_available("FEATURE_NAME")
end
def is_feature_available(code)
return true if $ld_client.variation(code, {:key => user.id}, false)
api_error(ERROR_MSG.disabled_feature, ApiMessage::ERROR_CODE_FORBIDDEN)
end
If the feature flag is off, the first time I ran this code, everything works fine and I get the expected error. If I reload the page, I get this error
It's unclear exactly what's going on here, but based on the stacktrace, it seems like it is a Ruby runtime issue; there's no way as far as I know for our Ruby SDK code to cause a segfault itself, since we don't have any native code. I've seen a similar report here - I say similar because in both cases the crash happens when trying to push a value onto a Queue, in Ruby 2.5.x. I've also seen segfaults with synchronization primitives in 2.5.x, as reported here - unfortunately I can't tell from that bug report whether it actually got fixed in a later version.
As for why this would only happen when the feature flag is off, and not when it's on... I can't explain that at all. The code where the crash is happening (putting an analytics event on the event queue) will be executed the same way, with almost exactly the same values, regardless of whether the flag is off or on. So all I can imagine is that it's either a coincidence, or something timing-related (i.e. maybe the different code paths for "flag on" and "flag off" are different enough in execution time that they affect whether the buggy synchronization code in the runtime will have a problem or not).
In any case, I'm sorry I don't have more helpful information at this point, but I do think this is very likely to be a problem with the underlying Ruby runtime. So, if possible, the first thing I would try would be using a different Ruby version.
Activity
eli-darkly commentedon Feb 11, 2019
Sorry for the late response.
It's unclear exactly what's going on here, but based on the stacktrace, it seems like it is a Ruby runtime issue; there's no way as far as I know for our Ruby SDK code to cause a segfault itself, since we don't have any native code. I've seen a similar report here - I say similar because in both cases the crash happens when trying to push a value onto a Queue, in Ruby 2.5.x. I've also seen segfaults with synchronization primitives in 2.5.x, as reported here - unfortunately I can't tell from that bug report whether it actually got fixed in a later version.
As for why this would only happen when the feature flag is off, and not when it's on... I can't explain that at all. The code where the crash is happening (putting an analytics event on the event queue) will be executed the same way, with almost exactly the same values, regardless of whether the flag is off or on. So all I can imagine is that it's either a coincidence, or something timing-related (i.e. maybe the different code paths for "flag on" and "flag off" are different enough in execution time that they affect whether the buggy synchronization code in the runtime will have a problem or not).
In any case, I'm sorry I don't have more helpful information at this point, but I do think this is very likely to be a problem with the underlying Ruby runtime. So, if possible, the first thing I would try would be using a different Ruby version.
Merge pull request #116 from launchdarkly/eb/ch37610/skip-db-tests
bwoskow-ld commentedon May 28, 2019
Hi Mario,
Are you still running into this issue?
Did you happen try running your application with a different Ruby version?