Nova hangs when creating a locale of a page

When creating a locale of a page - Nova admin hangs. Normal create works, no problems.
Tried to find the issue, but can't isolate where it happens.
The resource gets saved in the database - though, but after that, nothing is happening and screen freezes.

Hey.
Maybe something to do with your custom resources? Check the XHR request responses in the dev tools.
I haven't been able to reproduce this on my end.

Yeah, will try to isolate it, everything worked before those latest changes.
Thanks.

Strange issue - when I click "Update & Editing" it refreshes nicely. Don't think it has anything to do with recent changes - have also reverted back to 1.5.2 and no difference.

Do the Nova API requests return normal responses? Not crashing etc?

When "Update & Editing" yes, when only "Update" - I get no response - a blank screen that hangs and hangs. As far as I've inspected - both requests are the same.

This happens only on editing/creating locales and not on main resource. It is really really strange - I just can't find the problem. I will try to install on a different server to see if that is the issue.

OK, found out the issue was with this package:
invato/redirect-to-index
Now removed it and it works. Closing.


Health Metric does not recover

Health metric does not recover (become 1) for an endpoint the was unreachable on startup and later became reachable again.

Clarification: recovery works with 2.10.0, but only if the /.well-known/jwks.json endpoint is called.


[Update term] Ingress for En

1. Please describe why this term needs to be updated
Why this term needs to be updated? (briefly)

Follow up to https://github.com/cncf/glossary/pull/2397, “Ingress” doesn’t look like it’s showing up in the sidebar list of terms.
Update frontmatter status to “Completed”
Update frontmatter to remove empty tags entries

2. Checklist

[X] I understand that maintainers will confirm if the term should be updated. (Please be patient)
[X] I want to work on this suggestion and confirm that I meet the criteria as outlined in "who can contribute".. (If not checked, maintainers will assign another volunteer)

(Note)
Maintainers will assign a label after assessment procedure.
(from triage/awaiting to triage/accepted or triage/not accepted)
A contributor can be assigned to this issue after the issue get the triage/accepted label.
The assignee needs to check Style Guide.

hey @nate-double-u!
I would like to work on this.

You're welcome to @professorabhay 🙂

Hey, @nate-double-u! I'm starting to work on it.
Kindly share some more details if possible.

The frontmatter is this section:
---
title: Ingress
status: Feedback Appreciated
category: technology
tags: ["fundamental", "", ""]
---

Related issue: https://github.com/cncf/glossary/issues/2679

Hi @professorabhay, how are things going?
I'd like to get this update in soon, so if you're not able to do so by Monday Dec 11, may I reassign it?

Hey @nate-double-u, Kindly take a look to the PR.


How to provide sparsity of the Jacobian to trust-constr solver

Hi, I'm trying to solve a simple optimization problem, taken from http://apmonitor.com/che263/index.php/Main/PythonOptimization and modified in order to use non linear constraints. I am trying to provide the sparsity of the jacobian matrix of the constraints as well, to speed up the process, but I have the following error:
Traceback (most recent call last):
  File "/usr/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/snap/pycharm-professional/132/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/snap/pycharm-professional/132/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/francesco/git_workspace/FESTIP_Work/MultipleShooting_Algorithm/testMS5.py", line 48, in <module>
    solution = minimize(objective,x0,method='trust-constr', bounds=bnds,constraints=[conseq], options={'verbose':3})
  File "/usr/local/lib/python3.6/dist-packages/scipy/optimize/_minimize.py", line 613, in minimize
    callback=callback, **options)
  File "/usr/local/lib/python3.6/dist-packages/scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py", line 514, in _minimize_trustregion_constr
    factorization_method)
  File "/usr/local/lib/python3.6/dist-packages/scipy/optimize/_trustregion_constr/tr_interior_point.py", line 309, in tr_interior_point
    constr_eq0, jac_eq0)
  File "/usr/local/lib/python3.6/dist-packages/scipy/optimize/_trustregion_constr/tr_interior_point.py", line 53, in __init__
    self.fun0 = self._compute_function(fun0, constr_ineq0, s0)
  File "/usr/local/lib/python3.6/dist-packages/scipy/optimize/_trustregion_constr/tr_interior_point.py", line 93, in _compute_function
    s[self.enforce_feasibility] = -c_ineq[self.enforce_feasibility]
IndexError: arrays used as indices must be of integer (or boolean) type

This is the code I'm using:
import numpy as np
from scipy.optimize import minimize, NonlinearConstraint
from scipy.sparse import coo_matrix

def objective(x):
    return x[0]*x[3]*(x[0]+x[1]+x[2])+x[2]

def constraint3(x):
    return np.array(((x[0]**2+x[1]**2 - 4),
                     (x[0]+x[1]-6),
                     (x[2]*x[3]**2-9),
                     (x[2] ** 2 - x[3] - 5)))

n = 4

row  = np.array([0, 0, 1, 1, 2, 2, 3, 3], dtype=np.int8)
col  = np.array([0, 1, 0, 1, 2, 3, 2, 3], dtype=np.int8)
data = np.ones((8), dtype=np.int8)
sparseJac = coo_matrix((data, (row, col)), shape=(4, 4)).toarray()

conseq = NonlinearConstraint(constraint3, (-np.inf, -np.inf, -np.inf, -np.inf), (np.inf, np.inf, np.inf, np.inf), finite_diff_jac_sparsity=sparseJac)
x0 = np.zeros(n)
x0[0] = 1.0
x0[1] = 5.0
x0[2] = 5.0
x0[3] = 1.0

print('Initial Objective: ' + str(objective(x0)))

b = (1.0,5.0)
bnds = (b, b, b, b)

solution = minimize(objective,x0,method='trust-constr', bounds=bnds,constraints=[conseq], options={'verbose':3})
x = solution.x

print('Final Objective: ' + str(objective(x)))

print('Solution')
print('x1 = ' + str(x[0]))
print('x2 = ' + str(x[1]))
print('x3 = ' + str(x[2]))
print('x4 = ' + str(x[3]))

What could be the issue? Am I using the NonlinearConstraint function in the wrong way?
Thank you for you time!

Hi!
First of all, technically github issues is not a QA resource like stackoverflow. But I'm personally fine with answering such questions (and sometimes they might reveal issues with the code).
So for your example:

I don't see how the coded constraints correspond to constraints in the problem in the link you gave. How did you come up with them?
Putting all bounds to (-np.inf, np.inf) for constraints actually disables them.
For such a small constraints amount you don't need to provide Jacobian sparsity.
And finally your code example works for me, giving:

`gtol` termination condition is satisfied.
Number of iterations: 29, function evaluations: 130, CG iterations: 40, optimality: 6.68e-09, constraint violation: 0.00e+00, execution time: 0.33 s.
Final Objective: 4.003200437286136
Solution
x1 = 1.000207134365899
x2 = 1.0007990157056421
x3 = 1.000399272425455
x4 = 1.0002578418264054

Try to update numpy and scipy.
If still doesn't work, provide your versions info, by
python -c "import numpy; import scipy; import sys; print(numpy.__version__, scipy.__version__, sys.version_info)"

Hi, thank you for the answer and sorry for the misuse of github issue section!
The constraints are different from the problem I linked because I added them in order to have non linear constraints and they are completely random. I used this code only to test the NonlinearConstraint function and yes, I know that to provide the jacobian for such problem is eccessive.
Anyway, thank you for pointing out that (-np.inf, np.inf) actually disable the constraints. I found that this was the issues so after changing them to one-sided constraints, it works.


Remove unneeded padding field from MemoryDescriptor struct

The purpose of adding this field is to enforce correct alignment. But #[repr(C)] already enforces it.
Let's see structure alignment with and without this field:
With padding field:
pub struct MemoryDescriptor {
    // size: 4, alignment: 4, offset: 0
    pub ty: MemoryType,
    // size: 4, alignment: 4, offset: 4
    padding: u32,
    // size: 8, alignment: 8, offset: 8
    pub phys_start: PhysicalAddress,
    // size: 8, alignment: 8, offset: 16
    pub virt_start: VirtualAddress,
    // size: 8, alignment: 8, offset: 24
    pub page_count: u64,
    // size: 8, alignment: 8, offset: 32
    pub att: MemoryAttribute,
}

Without padding field:
pub struct MemoryDescriptor {
    // size: 4, alignment: 4, offset: 0
    pub ty: MemoryType,
    // size: 8, alignment: 8, offset: 8
    pub phys_start: PhysicalAddress,
    // size: 8, alignment: 8, offset: 16
    pub virt_start: VirtualAddress,
    // size: 8, alignment: 8, offset: 24
    pub page_count: u64,
    // size: 8, alignment: 8, offset: 32
    pub att: MemoryAttribute,
}

As you can see, these memory layouts are the same one. So there's no need for a useless private field that makes working with the type harder (e.g. you can't use structure declaration to create an instance of this struct). So I suggest to remove the padding field.

I agree the padding field seems unnecessary. I see you have a commit that removes it, please feel free to put up a PR in this repo.

The question is if it is worth it to switch from an explicit approach to an implicit one. It increases the risk for future changes, theoretically. However, significant changes to this code are unlikely.

A couple arguments in favor of removing the padding:

It matches what we do elsewhere for most structs; we typically don't explicitly specify padding fields.
It matches how the struct is defined in the UEFI spec

Thanks for pointing that out.


Update developer guide

Update UI component and existing diagram
Add in findGroup command

Codecov Report

Merging #219 (77d8a79) into master (4b5f119) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #219   +/-   ##
=========================================
  Coverage     48.38%   48.38%
  Complexity      611      611
=========================================
  Files           134      134
  Lines          3094     3094
  Branches        402      402
=========================================
  Hits           1497     1497
  Misses         1527     1527
  Partials         70       70

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b5f119...77d8a79. Read the comment docs.


#25: Fix warnings

Currently started reworking the permission request. There is a bug here, but in a very rare scenario. Steps to reproduce:

On a fresh app, open the app
Grant storage permissions
Add a root
Without closing the app completely, go to app settings on the device, and revoke the storage permissions
Go back into the app (the app should ask for storage permissions again)
Deny the permission (saved root folder should still be present)
Click on those roots and click the navigate button, the app may crash or behave unexpectedly

Otherwise, I tried blocking all interactions until we have storage permissions. How do you think we should handle that event, and similar ones? My suggestions are:

Clear the fragments, so the user will end up with a blank screen and nothing to interact with
Have some kind of a custom Router, that will check storage permissions when trying to make Fragment transactions
(I think it's a bad one, as it can cause memory leaks, but will toss it here) store "hasStoragePermissions" in MainActivity or other place as a variable, and check it from the Presenter and other places thoughout the app

@CloudLevi could you register this bug as issue?
Also, what does this warning mean? I don't see any usage of ANDROID_NDK_HOME in build scripts.

WARNING: Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.

Also please pull commits from main.

Btw, linter doesn't upload results last month. Could you also look what happened to it?


Config files, prediction steps and seeds.

Hi there!
I've been looking for parameters to manipulate both in the config files and code base that will allow me to control inpaint generation variables, such as how many steps go into predicting an image and how to change the seed in order to get a variation of the generated inpaint image. I've tried modifying the config files and setting the seed via the function provided but it doesn't seem to have any effect on the result.
Any assistance with getting me started in the right direction would be appreciated 🙏

Hi~
our method is a determinstic algorithm, the seed is corresponding to the training process.
As for the TSR inference steps, you can change the iterations below;
https://github.com/DQiaole/ZITS_inpainting/blob/6fd5fc0518eac201032ea1d90fd71310b9050a77/single_image_test.py#L243-L246

Thank you for sharing that!
I'm curious, what role do the add_v and mult_v play in the process and what do they contribute to the SampleEdgeLineLogits function?


[General] <Converting from .wav/mp3 to .bin file>

I am struggling to convert a .wav file to a .bin file.
I have been unable to find a converter that does this conversion and I need it in order to be able to safe some files into a program.
Does anyone know how to do it?
Thank you.

Hi @arantza12345,
This forum might not be the best place for you to receive help on file conversion questions, as it is primarily focused towards embedded devices. Have you considered trying Stack Exchange? You might be more able to receive help for your question there.
With that said, what is the use case for your .bin files? If any binary file will do regardless of format, can you just rename the .wav extension to .bin? If you need a specific disk image format, e.g. from a CD or DVD, can you just create a virtual disk image and burn your files to the virtual CD?

I'm closing this ticket due to inactivity. Please reopen this ticket if you would like any further assistance.


Typos, minor changes because of ui changes in BTP

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.nicogeburek seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Add missing space to security-hardening-for-github-actions.md

What's being changed (if available, include any code snippets, screenshots, or gifs):
There is a missing space in the documentation:

Check off the following:

[ ] A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require a SME review from GitHub staff.
[ ] The changes in this PR meet the docs fundamentals that are required for all content.
[ ] All CI checks are passing.

@fcasal Thanks so much for opening a PR with this fix! I'll update the branch and get this merged once tests are passing 🍏


repalce banner

Add & LINK TO PAGE:

Which banner am I replacing?

This is slightly the wrong size. In the future it should be 1400x500. 😀 You'll notice everything below the slider jumps a little bit as the images change.

Just ignore that, sorry
Sent from my iPhone

On Mar 30, 2018, at 8:34 AM, Adam Garrett-Harris<EMAIL_ADDRESS>wrote:
Closed #273 via fcdc96d.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


Consider give tch::kind::T a formal name and make it public

I found tch::kind::T useful for restricting types and writing generic impls. Do you consider make it a public trait and give it a longer name?

Sure, I renamed the trait to Element and it should now be public outside of the crate too.

Nice! The issue can be closed.


WIP ARROW-764: [C++] Improves performance of CopyBitmap and adds benchmarks

I took a swing at improving the CopyBitmap performance (benchmarks below).  I'm a C/C++ novice, so I thought I'd get some feedback before I went too much further.
Starting Point
Run on (4 X 2208 MHz CPU s)
12/13/17 21:15:18
Benchmark                                        Time           CPU Iterations
------------------------------------------------------------------------------
BM_CopyBitmap/97.6563k/0/min_time:1.000       4779 us       4758 us        289   20.0445MB/s
BM_CopyBitmap/976.563k/0/min_time:1.000      47740 us      47476 us         26   20.0875MB/s
BM_CopyBitmap/97.6563k/4/min_time:1.000       4858 us       4866 us        289   19.5991MB/s
BM_CopyBitmap/976.563k/4/min_time:1.000      48117 us      47953 us         29   19.8879MB/s

Using stanford bithacks for SetBitTo
Run on (4 X 2208 MHz CPU s)
12/13/17 21:22:05
Benchmark                                        Time           CPU Iterations
------------------------------------------------------------------------------
BM_CopyBitmap/97.6563k/0/min_time:1.000       1647 us       1649 us        815   57.8415MB/s
BM_CopyBitmap/976.563k/0/min_time:1.000      16368 us      16397 us         81   58.1629MB/s
BM_CopyBitmap/97.6563k/4/min_time:1.000       1599 us       1610 us        815   59.2186MB/s
BM_CopyBitmap/976.563k/4/min_time:1.000      16026 us      16011 us         81   59.5644MB/s

memcpy + shifting
This solution provides varying performance depending on whether or not the bit offset is a multiple of 8
Run on (4 X 2208 MHz CPU s)
12/13/17 21:23:44
Benchmark                                        Time           CPU Iterations
------------------------------------------------------------------------------
BM_CopyBitmap/97.6563k/0/min_time:1.000          5 us          5 us     280000   18.9651GB/s
BM_CopyBitmap/976.563k/0/min_time:1.000         62 us         61 us      22400   15.1721GB/s
BM_CopyBitmap/97.6563k/4/min_time:1.000        171 us        170 us       6892   560.872MB/s
BM_CopyBitmap/976.563k/4/min_time:1.000       1639 us       1639 us        896   581.782MB/s

Thanks for taking a look @xhochy.
My latest push fixes the formatting issues and also adds a test+fix for a few corner cases my first upload didn't handle correctly.
Benchmark with recent changes
Run on (4 X 2208 MHz CPU s)
12/22/17 15:14:31
Benchmark                                        Time           CPU Iterations
------------------------------------------------------------------------------
BM_CopyBitmap/97.6563k/0/min_time:1.000          5 us          5 us     270310   17.9019GB/s
BM_CopyBitmap/976.563k/0/min_time:1.000         65 us         65 us      21854   14.3143GB/s
BM_CopyBitmap/97.6563k/4/min_time:1.000        153 us        152 us       8960   628.592MB/s
BM_CopyBitmap/976.563k/4/min_time:1.000       1534 us       1535 us        896   621.449MB/s

w.r.t. the comments above in CMakeLists.txt, I actually have a separate pull request open for them at #1406.

@seibs Can resolve the two comments in the other pull request? I would then merge both :)


Adding 2022 container to deployment wizard

mcr.microsoft.com/mssql/server:2022-latest
for SQL Server 2022 (preview)

@dzsquared you read my mind, i was just about to ask when testing this feature.


DDPB-1019-pa-team-name store/load PA team name [TO DISCUSS]

@slizzio  approach that lets easily save the team name as part of the form, simplifying the client logic, and only one endpoint


Provide delay after performing orphan mitigation when Service Instance was failed

Hello,
We wrote about our issue in #2006. It's about infinite loop when Service Instance provision fails, e.g. when some condition from our business logic wasn't fulfilled.
The loop looks like this:
start provisioning -> fail, requires orphan mitigation -> perform orphan mitigation
-> start provisioning -> …

In the issue #2006, @nilebox suggested using reconciliation-retry-duration flag, but it didn't help us.
It defines how much time does the Service Catalog have to ask for the last operation.
In our case, each step is another operation so it won't work.
We need a similar solution but for the whole loop showed above.
These are the logs from the controller-manager when I started to provision a Service Instance which fails:
08:30:35.840997       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": Provision request for ServiceInstance in-flight to Broker
08:30:36.044199       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": The instance is being provisioned asynchronously
08:30:36.053577       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"production", Name:"promotions-service1", UID:"3edc6ed3-5363-11e8-83ff-0242ac110022", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"2317", FieldPath:""}): type: 'Normal' reason: 'Provisioning' The instance is being provisioned asynchronously
08:30:37.055727       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": Provision call failed: Forbidden provisioning instance [3edc6a28-5363-11e8-83ff-0242ac110022] for remote environment [id: ac031e8c-9aa4-4cb7-8999-0d358726ffaa] in namespace: [production]. Reason: [already activated]
08:30:37.055791       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": Provision call failed: Forbidden provisioning instance [3edc6a28-5363-11e8-83ff-0242ac110022] for remote environment [id: ac031e8c-9aa4-4cb7-8999-0d358726ffaa] in namespace: [production]. Reason: [already activated]
08:30:37.055872       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource
08:30:37.056042       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"production", Name:"promotions-service1", UID:"3edc6ed3-5363-11e8-83ff-0242ac110022", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"2318", FieldPath:""}): type: 'Warning' reason: 'ProvisionCallFailed' Provision call failed: Forbidden provisioning instance [3edc6a28-5363-11e8-83ff-0242ac110022] for remote environment [id: ac031e8c-9aa4-4cb7-8999-0d358726ffaa] in namespace: [production].  Reason: [already activated]
08:30:40.455026       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": Provision call failed: Forbidden provisioning instance [3edc6a28-5363-11e8-83ff-0242ac110022] for remote environment [id: ac031e8c-9aa4-4cb7-8999-0d358726ffaa] in namespace: [production]. Reason: [already activated]
08:30:40.455087       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource
08:30:40.455744       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"production", Name:"promotions-service1", UID:"3edc6ed3-5363-11e8-83ff-0242ac110022", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"2323", FieldPath:""}): type: 'Warning' reason: 'ProvisionCallFailed' Provision call failed: Forbidden provisioning instance [3edc6a28-5363-11e8-83ff-0242ac110022] for remote environment [id: ac031e8c-9aa4-4cb7-8999-0d358726ffaa] in namespace: [production]. Reason: [already activated]
08:30:40.455777       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"production", Name:"promotions-service1", UID:"3edc6ed3-5363-11e8-83ff-0242ac110022", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"2323", FieldPath:""}): type: 'Warning' reason: 'StartingInstanceOrphanMitigation' The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource
08:30:40.642871       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": The instance is being deprovisioned asynchronously
08:30:40.654647       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"production", Name:"promotions-service1", UID:"3edc6ed3-5363-11e8-83ff-0242ac110022", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"2324", FieldPath:""}): type: 'Normal' reason: 'Deprovisioning' The instance is being deprovisioned asynchronously
08:30:40.765473       1 controller_manager.go:414] Health-checking connection with service-catalog API server
08:30:42.471662       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": Orphan mitigation was completed successfully
08:30:42.482370       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"production", Name:"promotions-service1", UID:"3edc6ed3-5363-11e8-83ff-0242ac110022", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"2325", FieldPath:""}): type: 'Normal' reason: 'OrphanMitigationSuccessful' Orphan mitigation was completed successfully
08:30:42.639328       1 controller_instance.go:1143] ServiceInstance "production/promotions-service1": Provision request for ServiceInstance in-flight to Broker

and so on forever..
As you can see, the Service Catalog continuously spams our broker with provision and deprovision requests without any delay or maxRetries (or maxRetryDuration) amount.
We would expect a flow like this:
(start provisioning -> fail, requires orphan mitigation -> perform orphan mitigation ->  exponential delay) x maxRetries

Our idea is to provide an exponential delay after performing an orphan mitigation to avoid spamming the brokers.
Let us know what do you think about it :)
Also let us know if you need the code snippets from the Service Catalog where the whole cycle is executed.
Thank you in advance.

I'm using Service Catalog in version 0.2.17

@polskikiel Thank you for your report and suggestion. We also caught this problem. And, the version should be v0.1.17, right?

Thanks for reporting @polskikiel, the behavior you described suggests that we have a bug in our code.

Our idea is to provide an exponential delay after performing an orphan mitigation to avoid spamming the brokers.

That's exactly how we agreed it to behave, I think.
@kibbles-n-bytes can you you confirm? Any ideas what causes this bug. From memory, it means that we confirm some stage of the queue key processing as successfully complete (and don't return the error in the result that would trigger exponential retry delay)?

@jianzhangbjz Yes, sorry I meant v0.1.17.

@nilebox Yes, that's the intended behavior, so we definitely have a bug. My guess is the successful OM is clearing the rate limiter for the instance queue, so there isn't a backoff when the provision retries, though I haven't looked at the code in a while.

I understand that we must separate status updates out in the reconciliation loop, but it looks to me like this breaks the fundamentals around how the backoff and retry is supposed to work here

I agree, and the reason is that we treat 3 continuous stages of the reconciliation as part of one operation to meet OSB requirements, while normally in Kubernetes there are no stages?

Trying to debug this, I made the instance status update and Orphan Mitigation code return a failure to the worker so it would requeue with a backoff.  I can see that logging as I'd expect.  But I still see a very tight loop with the worker constantly being invoked - there is no backoff between invocations.
The worker()  (https://github.com/kubernetes-incubator/service-catalog/blob/master/pkg/controller/controller.go#L304-L335) seems to do the right thing when we indicate its a failure (I added debug to the https://github.com/kubernetes-incubator/service-catalog/blob/master/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go and can see its using increasing backoffs) but every time we exit the worker, instead of seeing for the backoff time elapse, I see the worker immediately re-invoked for the instance.  I believe the problem is the instance is getting requeued by https://github.com/kubernetes-incubator/service-catalog/blob/master/pkg/controller/controller_instance.go#L103 which is invoked from a thread with this call stack:
vendor/k8s.io/client-go/tools/cache.(*ResourceEventHandlerFuncs).OnUpdate(0xc4206a8ea0, 0x1a8d080, 0xc4201f2b40, 0x1a8d080, 0xc4201f3d40)
vendor/k8s.io/client-go/tools/cache.(*processorListener).run.func1.1(0xc4207480a0, 0x0, 0xc420025300)
vendor/k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff(0x989680, 0x3ff0000000000000, 0x3fb999999999999a, 0x5, 0xc42073adf0, 0x18, 0x8a0980)
vendor/k8s.io/client-go/tools/cache.(*processorListener).run.func1()
vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc42002cf68)
vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc42073af68, 0xdf8475800, 0x0, 0x1829501, 0xc420746060)
vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc42002cf68, 0xdf8475800, 0xc420746060)
vendor/k8s.io/client-go/tools/cache.(*processorListener).run(0xc420712100)
vendor/k8s.io/client-go/tools/cache.(*processorListener).(github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/client-go/tools/cache.run)-fm()
vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1(0xc42026a680, 0xc42043a000)
created by github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start

which I think is a watch on the instance kicking because it sees an update to the instance.
Does this make sense?  Should the watch be causing the reconciliation loop to fire immediately like this vs waiting for the backoff?
@kibbles-n-bytes this kind of sounds like #1143

@kibbles-n-bytes that definitely helps - I actually now see some exponential backoff.  By the time we get to max requeues (15), we have a 40 second delay.  It feels like we could stand to take a 2nd look at the starting delay factor - its really small at 5 milliseconds with a max repeat of only 15.
Eventually we hit max retries so the worker doesn't requeue and does a queue.Forget().  But a watch immediately triggers and puts the instance back into the queue and we start all over again resuming reconciliation where we left off which restarts the attempt to provision -> orphan mitigation all over again.
If we want to use the max requeue to determine when to stop this cycle of attempt to provision  -> orphan mitigation, reattempt...   then I think we'll need some new logic that changes the instance's status indicating we shouldn't re-attempt to provision again.  I don't know that the queue's NumRequeues(key) is a good mechanism to rely on for this though, I think perhaps a new provision attempt counter in the status would be better.  Or perhaps we could tell from the events  i.e., the number of times we've seen ProvisionCallFailed
Events:
  Type     Reason                             Age                 From                                Message
  ----     ------                             ----                ----                                -------
  Warning  ReferencesNonexistentServiceClass  39m (x12 over 39m)  service-catalog-controller-manager  References a non-existent ClusterServiceClass {ClassExternalName:"user-provided-service"} or there is more than one (found: 0)
  Warning  StartingInstanceOrphanMitigation   37m (x5 over 38m)   service-catalog-controller-manager  The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource
  Normal   OrphanMitigationSuccessful         14m (x49 over 38m)  service-catalog-controller-manager  Orphan mitigation was completed successfully
  Warning  ProvisionCallFailed                4m (x71 over 38m)   service-catalog-controller-manager  Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>

I'm not certain why I have those ReferencesNonexistentServiceClass events in there...

Eventually we hit max retries so the worker doesn't requeue and does a queue.Forget(). But a watch immediately triggers and puts the instance back into the queue and we start all over again resuming reconciliation where we left off which restarts the attempt to provision -> orphan mitigation all over again.

Hah! That's funny, but makes total sense. It's an unfortunate consequence of having two separate areas where we're dealing with queuing.
What is our desired behavior, and what matches other Kubernetes resource backoffs? The way it was intended, we were supposed to retry with backoff, until when we hit the maxRetries, where we stop. And then on the next watch sync, we would restart the retry loop with our rate limiter reset.
We could certainly fix it to do that, but depending on what other resources do, and what we desire, we may want to play around more with our queuing code. It may be that we should do quick retries only for things not hitting the broker, but then we have much longer retry intervals for things that communicate across the wire (like we do for async polling). Just depends what we want.

I've just observed this issue with one of our failing ServiceInstance. SC retries without backoff.

@ash2k was this failure on synchronous provisioning?  If not, any additional details would be great.

I see that when this issue is run with synchronous provisioning & deprovisioning with provisioning made to always fails, we actually invoke the provision call twice in a row and then the orphan mitigation twice in a row.
log details

I0523 15:19:16.172209       1 controller_instance.go:387] ServiceInstance "myproject/my-service-instance3": Provisioning a new ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker"
I0523 15:19:16.202978       1 client.go:206] handling failure responses
I0523 15:19:16.203076       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>

I0523 15:19:16.203092       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "Ready" to False
I0523 15:19:16.203109       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>
I0523 15:19:16.203106       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"myproject", Name:"my-service-instance3", UID:"a7bdd210-5e9c-11e8-a6dc-0242ac110008", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"20", FieldPath:""}): type: 'Warning' reason: 'ProvisionCallFailed' Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>
I0523 15:19:16.203125       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "OrphanMitigation" to True
I0523 15:19:16.203144       1 controller_instance.go:1182] ServiceInstance "myproject/my-service-instance3": Setting lastTransitionTime, condition "OrphanMitigation" to 2018-05-23 15:19:16.203103661 +0000 UTC m=+1123.166465631
I0523 15:19:16.203156       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource
I0523 15:19:16.203164       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "Ready" to False
I0523 15:19:16.203172       1 controller_instance.go:1211] ServiceInstance "myproject/my-service-instance3": Updating status
I0523 15:19:16.203238       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"myproject", Name:"my-service-instance3", UID:"a7bdd210-5e9c-11e8-a6dc-0242ac110008", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"20", FieldPath:""}): type: 'Warning' reason: 'StartingInstanceOrphanMitigation' The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource
I0523 15:19:16.207423       1 controller.go:366] Error syncing ServiceInstance myproject/my-service-instance3: Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>
I0523 15:19:16.212631       1 controller_instance.go:358] ServiceInstance "myproject/my-service-instance3": Processing adding event
I0523 15:19:16.212652       1 controller.go:457] ServiceInstance "myproject/my-service-instance3": Creating client for ClusterServiceBroker ups-broker, URL: http://ups-broker.kube-service-catalog.svc.cluster.local

I0523 15:19:16.213939       1 controller_instance.go:387] ServiceInstance "myproject/my-service-instance3": Provisioning a new ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker"
I0523 15:19:16.244728       1 client.go:206] handling failure responses
I0523 15:19:16.244863       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>

I0523 15:19:16.244876       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "Ready" to False
I0523 15:19:16.244891       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": Error provisioning ServiceInstance of ClusterServiceClass (K8S: "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" ExternalName: "user-provided-service") at ClusterServiceBroker "ups-broker": Status: 205; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>
I0523 15:19:16.244900       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "OrphanMitigation" to True
I0523 15:19:16.244916       1 controller_instance.go:1182] ServiceInstance "myproject/my-service-instance3": Setting lastTransitionTime, condition "OrphanMitigation" to 2018-05-23 15:19:16.244887274 +0000 UTC m=+1123.208249242
I0523 15:19:16.244925       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": The instance provision call failed with an ambiguous error; attempting to deprovision the instance in order to mitigate an orphaned resource

and then Orphan Mitigation twice:

I0523 15:19:16.514567       1 controller_instance.go:639] ServiceInstance "myproject/my-service-instance3": Sending deprovision request to broker
I0523 15:19:16.547852       1 controller_instance.go:1100] ServiceInstance "myproject/my-service-instance3": Removing condition "OrphanMitigation"
I0523 15:19:16.547882       1 controller_instance.go:1107] ServiceInstance "myproject/my-service-instance3": Found existing condition "OrphanMitigation": "True"; removing it
I0523 15:19:16.547888       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": Orphan mitigation was completed successfully
I0523 15:19:16.547894       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "Ready" to False
I0523 15:19:16.547899       1 controller_instance.go:1211] ServiceInstance "myproject/my-service-instance3": Updating status
I0523 15:19:16.551214       1 controller_instance.go:570] ServiceInstance "myproject/my-service-instance3": Processing deleting event
I0523 15:19:16.551244       1 controller.go:457] ServiceInstance "myproject/my-service-instance3": Creating client for ClusterServiceBroker ups-broker, URL: http://ups-broker.kube-service-catalog.svc.cluster.local
I0523 15:19:16.551298       1 controller_instance.go:639] ServiceInstance "myproject/my-service-instance3": Sending deprovision request to broker
I0523 15:19:16.551263       1 event.go:218] Event(v1.ObjectReference{Kind:"ServiceInstance", Namespace:"myproject", Name:"my-service-instance3", UID:"a7bdd210-5e9c-11e8-a6dc-0242ac110008", APIVersion:"servicecatalog.k8s.io", ResourceVersion:"21", FieldPath:""}): type: 'Normal' reason: 'OrphanMitigationSuccessful' Orphan mitigation was completed successfully
I0523 15:19:16.581732       1 controller_instance.go:1100] ServiceInstance "myproject/my-service-instance3": Removing condition "OrphanMitigation"
I0523 15:19:16.581751       1 controller_instance.go:1107] ServiceInstance "myproject/my-service-instance3": Found existing condition "OrphanMitigation": "True"; removing it
I0523 15:19:16.581757       1 controller_instance.go:1143] ServiceInstance "myproject/my-service-instance3": Orphan mitigation was completed successfully
I0523 15:19:16.581763       1 controller_instance.go:1144] ServiceInstance "myproject/my-service-instance3": Setting condition "Ready" to False
I0523 15:19:16.581769       1 controller_instance.go:1211] ServiceInstance "myproject/my-service-instance3": Updating status

proposed quick term fix:  enforce a delay of X between retry attempts provisioning an instance.  X defaults to 10 minutes, but can be over ridden with a controller parameter if customers have concerns about their brokers being hit too much.
@pmorie and I have discussed, I've got the basics working.  @kibbles-n-bytes does this sound ok to you for a short term solution?  Keeps us from pounding brokers.  Obviously we have to come back in here and fix the real issue.
The work around looks to be achievable by maintaining an in memory list of instances with a retry-no-earlier-then timestamp, perhaps set it in Orphan Mitigation and a new check against it before we do an Add.  I'm close to having a working fix.


Upgrade to Webpack v4

This issue is to track upgrading xstate to Webpack v4, especially for making the package tree-shakeable, which it should already be capable of doing, since all files are side-effect-free.
We will also want to set up a single configuration file so that we output four separate files:

xstate.js (the core xstate Machine creator)
xstate.utils.js (graph and testing utilities)
xstate.patterns.js (helpful state machine patterns, such as toggles, sequences, promises, etc.)
xstate.interpreter.js (the default xstate interpreter, with inspiration from @avaragado's xstateful)

I'm up for the task - but I'm not sure what we want to achieve here, so I'd like to establish it first.
In general when consuming this package bundlers reach out for files generated by TS - the ones specified in main & module entries of the package.json.
webpack is used here merely to create UMD filed & they are most commonly non-treeshakeable & also their usage is rather niche. Also - you could (I could help with that) switch to rollup for generating them as in general it does a better job when it comes to bundling libraries.
What could be done is to annotate all top-level calls with #__PURE__ comments to let UglifyJS eliminate them as dead code (if their results stay unused ofc). This can be automated.

I would be open to using Rollup 👍

I'm still unsure about the goals though, should I just rollup 4 separate (self-contained) UMD bundles? Or should I flat bundle the library into 4 files but with shared (common) parts?

friendly 🏓

@Andarist Sorry for the late reply!

Or should I flat bundle the library into 4 files but with shared (common) parts?

^ This - the main xstate.js bundled file should be self-contained, though. The others can depend on it.

Closing this - using Rollup instead.