question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client.submit not working with client.upload_file after first time

See original GitHub issue

Below are my local and cloud Dask version.

Dask version: 2.14 Distributed version: 2.14

We have a production Dask cluster in GKE, and shared among our engineers. Now, we want to create a python script for boilerplate purpose, simply name, boilerplate.py,

def inc(x):
    if x > 10:
        raise Exception('x > 10')
    return x + 1

And our client script,

from dask.distributed import Client
import boilerplate as bp
bootstrap = # proxied
client = Client(bootstrap)
client.upload_file('boilerplate.py')

client.submit(bp.inc,7).result() # no error
client.submit(bp.inc,11).result() # got error

Now we fixed boilerplate.py,

def inc(x):
    if x > 20:
        raise Exception('x > 20')
    return x + 1

And rerun client script to reupload fixed boilerplate.py,

from dask.distributed import Client
Exception: x > 10
bootstrap = # proxied
client = Client(bootstrap)
client.upload_file('boilerplate.py')

client.submit(bp.inc,7).result() # no error
client.submit(bp.inc,11).result() # got error

It is still same exception,

Exception: x > 10

The problem here, we cannot restart our Dask cluster, it might disturb other important tasks. It might seems got some caching layer here, this is only happened if we use file_upload + submit, if we use file_upload + run, it use latest update boilerplate.py.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TomAugspurgercommented, Apr 27, 2020

Let us know if you’re able to do more debugging.

Given the complexities here, I don’t really see how Dask can support re-uploading modules with upload_file. I’d recommend investigating alternative ways of doing this.

We can reopen if you find a specific issue or a solution that works well generally.

0reactions
huseinzol05commented, Jul 22, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly use dask's upload_file() to pass local code to ...
The upload_file method only uploads the file to the currently available workers. If a worker arrives after you call upload_file then that worker ......
Read more >
C# client: file upload problem - ServiceStack Customer Forums
Hi, I'm trying to upload a file, but for some reason the service gets only the first. After upload file called dispose?
Read more >
10423: Drake Portals - Uploading Documents for Client Pickup
On the Files tab in the Drake Portals pane, select which Folder into which you want to upload the file. For example, choose...
Read more >
The common mistake people make with boto3 file upload
Boto3 users encounter problems too while trying to use Boto3 File Upload, ... Here's the code to upload a file using the client....
Read more >
Handling File Uploads With Flask - miguelgrinberg.com
From a high-level perspective, a client uploading a file is treated the same as any other form data submission. In other words, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found